Part Number Hot Search : 
78L05 UPC2900 LBA025M2 1N5243B TUA1574 16360 HVD132 5S211
Product Description
Full Text Search
 

To Download HD407A4359R Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hd404358 series rev. 6.0 sept. 1998 description the hd404358 series is a 4-bit hmcs400-series microcomputer designed to increase program productivity and also incorporate large-capacity memory. each microcomputer has an a/d converter, input capture timer, and two low-power dissipation modes. the hd404358 series includes seven chips: the hd404354, hd40a4354 with 4-kword rom; the hd404356, hd40a4356 with 6-kword rom; the hd404358, hd40a4358 with 8-kword rom; the hd407a4359 with 16-kword prom. the hd40a4354, hd40a4356, ha40a4358, and hd407a4359 are high speed versions (minimum instruction cycle time: 0.47 m s) the hd407a4359 is a prom version (ztat ? microcomputer). a program can be written to the prom by a prom writer, which can dramatically shorten system development periods and smooth the process from debugging to mass production. (the ztat ? version is 27256-compatible.) ztat ? : zero turn around time ztat is a trademark of hitachi ltd. features 34 i/o pins ? one input-only pin ? 33 input/output pins: 4 pins are intermediate-voltage nmos open drain with high-current pins (15 ma, max.) on-chip a/d converter (8-bit 8-channel) ? low power voltage 2.7 v to 6.0 v three timers ? one event counter input ? one timer output ? one input capture timer eight-bit clock-synchronous serial interface (1 channel) alarm output
hd404358 series 2 built-in oscillators ? ceramic oscillator or crystal ? external clock drive is also possible seven interrupt sources ? two by external sources ? three by timers ? one by a/d converter ? one by serial interface two low-power dissipation modes ? standby mode ? stop mode instruction cycle time ? 0.47 m s (f osc = 8.5 mhz, 1/4 division ratio): hd40a4354, hd40a4356, hd40a4358, hd407a4359 ? 0.8 m s (f osc = 5 mhz, 1/4 division ratio): hd404354, hd404356, hd404358 ordering information type instruction cycle time product name model name rom (words) ram (digit) package mask rom standard versions hd404354 hd404354s 4,096 384 dp-42s (f osc = 5 mhz) hd404354h fp-44a hd404356 hd404356s 6,144 dp-42s hd404356h fp-44a hd404358 hd404358s 8,192 dp-42s hd404358h fp-44a high speed versions hd40a4354 hd40a4354s 4,096 384 dp-42s (f osc = 8.5 mhz) hd40a4354h fp-44a hd40a4356 hd40a4356s 6,144 dp-42s hd40a4356h fp-44a hd40a4358 hd40a4358s 8,192 dp-42s hd40a4358h fp-44a ztat ? (f osc = 8.5 mhz) hd407a4359 hd407a4359s 16,384 512 dp-42s hd407a4359h fp-44a
hd404358 series 3 pin arrangement 1 2 3 4 5 6 7 8 9 10 11 33 32 31 30 29 28 27 26 25 24 23 12 13 14 15 16 17 18 19 20 21 22 44 43 42 41 40 39 38 37 36 35 34 fp-44a test reset osc 1 osc 2 gnd av ss r3 0 /an 0 r3 1 /an 1 r3 2 /an 2 r3 3 /an 3 r4 0 /an 4 r1 2 r8 3 r8 2 r8 1 r8 0 d 8 d 7 d 6 d 5 r1 1 r1 0 nc r0 3 r0 2 r0 1 r0 0 ra 1 r2 3 r2 2 r2 1 r2 0 r1 3 / sck /si /so /toc r4 1 /an 5 av cc v cc d 0 / int 0 d 1 / int 1 d 2 /evnb d 3 /buzz d 4 / stopc nc r4 2 /an 6 r4 3 /an 7 r0 0 / sck r0 1 /si r0 2 /so r0 3 /toc test reset osc 1 osc 2 av ss r8 3 r8 2 r8 1 r8 0 d 8 d 7 d 6 d 5 d 4 / stopc d 3 /buzz d 2 /evnb d 1 / int 1 d 0 /int 0 ra 1 r2 3 r2 2 r2 1 r2 0 r1 3 r1 2 r1 1 r1 0 dp-42s 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 29 28 27 26 25 24 23 22 42 41 40 39 38 37 36 35 34 33 32 31 30 v cc av cc r3 0 /an 0 r3 1 /an 1 r3 2 /an 2 r3 3 /an 3 r4 0 /an 4 r4 1 /an 5 r4 2 /an 6 r4 3 /an 7 gnd
hd404358 series 4 pin description pin number item symbol dp-42s fp-44a i/o function power supply v cc 21 16 applies power voltage gnd 10 5 connected to ground test test 6 1 i cannot be used in user applications. connect this pin to gnd. reset reset 7 2 i resets the mcu oscillator osc 1 8 3 i input/output pin for the internal oscillator. connect these pins to the ceramic oscillator or crystal oscillator, or osc 1 to an external oscillator circuit. osc 2 94o port d 0 ? 8 22?0 17?1, 23?6 i/o input/output pins addressed individually by bits; d 0 ? 8 are all standard-voltage i/o pins. ra 1 1 39 i one-bit standard-voltage input port pin r0 0 ?1 3 , r3 0 ?4 3 , r8 0 ?8 3 2?, 12?9, 31?8 40?3, 7?4 27?4 i/o four-bit input/output pins consisting of standard-voltage pins r2 0 ?2 3 39?2 35?8 i/o four-bit input/output pins consisting of intermediate voltage pins interrupt int 0 , int 1 22, 23 17, 18 i input pins for external interrupts stop clear stopc 26 21 i input pin for transition from stop mode to active mode serial interface sck 2 40 i/o serial interface clock input/output pin si 3 41 i serial interface receive data input pin so 4 42 o serial interface transmit data output pin timer toc 5 43 o timer output pin evnb 24 19 i event count input pin alarm buzz 25 20 o square waveform output pin a/d converter av cc 20 15 power supply for the a/d converter. connect this pin as close as possible to the v cc pin and at the same voltage as v cc . if the power supply voltage to be used for the a/d converter is not equal to v cc , connect a 0.1- m f bypass capacitor between the av cc and av ss pins. (however, this is not necessary when the av cc pin is directly connected to the v cc pin.) av ss 11 6 ground for the a/d converter. connect this pin as close as possible to gnd at the same voltage as gnd. an 0 ?n 7 12?9 7?4 i analog input pins for the a/d converter
hd404358 series 5 block diagram d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 r0 0 r0 1 r0 2 r0 3 d port r0 port r1 0 r1 1 r1 2 r1 3 r1 port r2 0 r2 1 r2 2 r2 3 r2 port r3 0 r3 1 r3 2 r3 3 r3 port r4 0 r4 1 r4 2 r4 3 r4 port r8 0 r8 1 r8 2 r8 3 r8 port ra 1 pc (14 bits) instruction decoder sp (10 bits) b (4 bits) a (4 bits) st (1 bit) ca (1 bit) alu spy (4 bits) y (4 bits) spx (4 bits) x (4 bits) w (2 bits) ram (384 4 bits) (512 4 bits) system control interrupt control timer a timer b timer c serial interface a/d converter buzzer internal data bus internal data bus internal address bus buzz av cc an 7 av ss an 0 si so sck toc evnb int 0 int 1 data bus intermediate voltage pin directional signal line gnd v cc osc 2 osc 1 stopc test reset ra port rom (4,096 10 bits) (6,144 10 bits) (16,384 10 bits)(8,192 10 bits)
hd404358 series 6 memory map rom memory map the rom memory map is shown in figure 1 and described below. vector address area ($0000?000f): reserved for jmpl instructions that branch to the start addresses of the reset and interrupt routines. after mcu reset or an interrupt, program execution continues from the vector address. zero-page subroutine area ($0000?003f): reserved for subroutines. the program branches to a subroutine in this area in response to the cal instruction. pattern area ($0000?0fff): contains rom data that can be referenced with the p instruction. program area ($0000-$0fff (hd404354, hd40a4354), $0000?17ff (hd404356, hd40a4356), $0000?1fff (hd404358, hd40a4358), $0000?3fff (hd407a4359)): the entire rom area can be used for program coding. $000f $0fff $1800 $0010 $003f $0040 vector address (16 words) zero-page subroutine (64 words) pattern (4,096 words) program (4,096 words) program (8,192 words) $0000 $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000a $000b $000c $000d $000e $000f 0 1 jmpl instruction (jump to reset , stopc routine) jmpl instruction (jump to int routine) jmpl instruction (jump to timer a routine) jmpl instruction (jump to timer b routine) jmpl instruction (jump to timer c routine) jmpl instruction (jump to a/d converter routine) jmpl instruction (jump to int routine) jmpl instruction (jump to serial routine) for hd404358, hd40a4358 program (16,384 words) hd407a4359 $1fff $2000 $3fff for hd404354, hd40a4354 $1000 program (6,144 words) for hd404356, hd40a4356 $17ff note: since the rom address areas between $0000?0fff overlap, the user can determine how these areas are to be used. figure 1 rom memory map
hd404358 series 7 ram memory map the hd404354, hd40a4354, hd404356, hd40a4356, hd404358 and hd40a4358 mcus contain 384- digit 4-bit ram areas. the hd407a4359 mcu contain 512-digit 4-bit ram areas. both of these ram areas consist of a memory register area, a data area, and a stack area. in addition, an interrupt control bits area, special function register area, and register flag area are mapped onto the same ram memory space labeled as a ram-mapped register area. the ram memory map is shown in figure 2 and described below. ram-mapped register area ($000?03f): interrupt control bits area ($000?003) this area is used for interrupt control bits (figure 3). these bits can be accessed only by ram bit manipulation instructions (sem/ semd, rem/remd, and tm/tmd). however, note that not all the instructions can be used for each bit. limitations on using the instructions are shown in figure 4. special function register area ($004?01f, $024?03f) this area is used as mode registers and data registers for external interrupts, serial interface, timer/counters, a/d converter, and as data control registers for i/o ports. the structure is shown in figures 2 and 5. these registers can be classified into three types: write-only (w), read-only (r), and read/write (r/w). ram bit manipulation instructions cannot be used for these registers. register flag area ($020?023) this area is used for the dton, wdon, and other register flags and interrupt control bits (figure 3). these bits can be accessed only by ram bit manipulation instructions (sem/ semd, rem/remd, and tm/tmd). however, note that not all the instructions can be used for each bit. limitations on using the instructions are shown in figure 4. memory register (mr) area ($040?04f): consisting of 16 addresses, this area (mr0?r15) can be accessed by register-register instructions (lamr and xmra). the structure is shown in figure 6. data area ($050?17f for hd404354/hd40a4354/hd404356/hd40a4356/hd404358/hd40a4358, $050?1ff for hd407a4359) stack area ($3c0?3ff): used for saving the contents of the program counter (pc), status flag (st), and carry flag (ca) at subroutine call (cal or call instruction) and for interrupts. this area can be used as a 16-level nesting subroutine stack in which one level requires four digits. the data to be saved and the save conditions are shown in figure 6. the program counter is restored by either the rtn or rtni instruction, but the status and carry flags can only be restored by the rtni instruction. any unused space in this area is used for data storage.
hd404358 series 8 ram memory map a/d channel register (acr) $000 $000 $040 $050 $003 $004 $005 $006 $007 $008 $009 $00a $00b $00c $00d $00e $00f $020 $023 $033 $00a $00b $00e $00f w w r/w w w w w w w w w w r r r r w r/w r/w r/w r/w r/w $3c0 ram-mapped registers memory registers (mr) stack (64 digits) interrupt control bits area port mode register a (pmra) serial mode register (smr) serial data register lower (srl) serial data register upper (sru) timer mode register a (tma) timer mode register b1 (tmb1) timer b (trbl/twbl) (trbu/twbu) miscellaneous register (mis) timer mode register c (tmc) timer c (trcl/twcl) (trcu/twcu) register flag area port r0 dcr (dcr0) port r3 dcr (dcr3) not used 1. two registers are mapped on the same area ($00a, $00b, $00e, $00f). 2. undefined. timer read register b lower (trbl) timer read register b upper (trbu) timer read register c lower (trcl) timer read register c upper (trcu) timer write register b lower (twbl) timer write register b upper (twbu) timer write register c lower (twcl) timer write register c upper (twcu) r: read only w: write only r/w: read/write $200 notes: $016 r a/d data register lower (adrl) $017 $024 $025 $026 $018 $019 $01a $3ff a/d data register upper (adru) a/d mode register 1 (amr1) a/d mode register 2 (amr2) r w w w port mode register b (pmrb) port mode register c (pmrc) timer mode register b2 (tmb2) not used w w w $030 not used not used not used -000 0000 0000 undefined undefined -000 0000 * 2 /0000 00-- 0000 0000 0000 0000 1000 0000 --00 0000 00-0 -000 undefined * 2 /0000 undefined * 1 initial values after reset $03f hd404354, hd40a4354, hd404356, hd40a4356, hd404358, hd40a4358 data (304 digits) hd407a4359 data (432 digits) 0000 0000 ---0 port d 0 ? 3 port d 4 ? 7 port d dcr 8 port r1 dcr (dcr1) port r2 dcr (dcr2) w w 0000 0000 w w w 0000 w port r8 dcr (dcr8) dcr dcr (dcd0) (dcd1) (dcd2) $02c $02d $02e $02f $031 $032 $038 not used not used $180 $034 w port r4 dcr (dcr4) 0000 figure 2 ram memory map
hd404358 series 9 0 1 2 3 bit 3 bit 2 bit 1 bit 0 imta (im of timer a) ifta (if of timer a) im1 (im of int 1 ) if1 (if of int 1 ) imtc (im of timer c) iftc (if of timer c) imtb (im of timer b) iftb (if of timer b) ims (im of serial) ifs (if of serial) imad (im of a/d) ifad (if of a/d) $000 $001 $002 $003 interrupt control bits area im0 (im of int 0 ) if0 (if of int 0 ) rsp (reset sp bit) ie (interrupt enable flag) 32 33 34 35 icsf (input capture status flag) $020 $021 $022 $023 register flag area adsf (a/d start flag) wdon (watchdog on flag) icef (input capture error flag) rame (ram enable flag) iaof (i ad off flag) if: im: ie: sp: interrupt request flag interrupt mask interrupt enable flag stack pointer bit 3 bit 2 bit 1 bit 0 not used not used not used figure 3 configuration of interrupt control bits and register flag areas ie im iaof if icsf icef rame rsp wdon adsf not used sem/semd rem/remd tm/tmd allowed allowed allowed not executed allowed allowed not executed allowed inhibited allowed not executed inhibited allowed inhibited allowed not executed not executed inhibited note: wdon is reset by mcu reset or by stopc enable for stop mode cancellation. the rem or remd instuction must not be executed for adsf during a/d conversion. if the tm or tmd instruction is executed for the inhibited bits or non-existing bits, the value in st becomes invalid. figure 4 usage limitations of ram bit manipulation instructions
hd404358 series 10 $000 $003 pmra $004 smr $005 srl $006 sru $007 tma $008 tmb1 $009 trbl/twbl $00a trbu/twbu $00b mis $00c tmc $00d trcl/twcl $00e trcu/twcu $00f acr $016 adrl $017 adru $018 amr1$019 amr2 $01a $020 $023 pmrb $024 pmrc $025 tmb2 $026 dcd0 $02c dcd1 $02d dcd2 $02e dcr0 $030 dcr1 $031 dcr2 $032 dcr3 $033 dcr4 $034 dcr8 $038 $03f bit 3 bit 2 bit 1 interrupt control bits area d 3 /buzz r0 3 /toc r0 2 /so serial transmit clock speed selection serial data register (lower digit) serial data register (upper digit) clock source selection (timer a) clock source selection (timer b) timer b register (lower digit) timer b register (upper digit) so pmos control clock source selection (timer c) timer c register (lower digit) timer c register (upper digit) analog channel selection a/d data register (lower digit) a/d data register (upper digit) register flag area port d 3 dcd port d 7 dcd port d 2 dcd port d 6 dcd port d 1 dcd port d 5 dcd port d 0 dcd port d 4 dcd port d 8 dcd port r0 3 dcr port r2 3 dcr port r4 3 dcr port r0 2 dcr port r2 2 dcr port r4 2 dcr port r0 1 dcr port r1 1 dcr port r2 1 dcr port r4 1 dcr port r0 0 dcr port r1 0 dcr port r2 0 dcr port r4 0 dcr 1. 2. 3. 4. 5. 6. r0 0 / sck bit 0 1 * 2 * 1 * auto-reload on/off pull-up mos control a/d conversion time so output level control in idle states serial clock source selection input capture selection notes: r0 1 /si r3 3 /an r3 2 /an 2 r3 1 /an 1 r3 0 /an 0 3 * r4/an 4 ?n 7 port r8 3 dcr port r8 2 dcr port r8 1 dcr port r8 0 dcr d 4 / stopc buzzer output d 2 /evnb * 6 d 1 / int 1 * 4 evnb detection edge selection d 0 / int 0 * 5 port r1 3 dcr port r3 3 dcr port r1 2 dcr port r3 2 dcr port r3 1 dcr port r3 0 dcr 3 not used not used not used not used not used not used not used not used not used not used not used not used figure 5 special function register area
hd404358 series 11 memory registers 64 65 66 67 68 69 70 71 73 74 75 76 77 78 79 72 $040 $041 $042 $043 $044 $045 $046 $047 $048 $049 $04a $04b $04c $04d $04e $04f 960 $3c0 1023 $3ff mr(0) mr(1) mr(2) mr(3) mr(4) mr(5) mr(6) mr(7) mr(8) mr(9) level 16 level 15 level 14 level 13 level 12 level 11 level 10 level 9 level 8 level 7 level 6 level 5 level 4 level 3 level 2 level 1 mr(10) mr(11) mr(12) mr(13) mr(14) mr(15) pc pc pc pc pc pc pc pc pc pc pc pc st pc ca pc 10 3 13 9 6 2 12 8 5 1 11 7 4 0 bit 3 bit 2 bit 1 bit 0 $3fc $3fd $3fe $3ff 1020 1021 1022 1023 pc ?c : st: status flag ca: carry flag program counter 13 stack area 0 figure 6 configuration of memory registers and stack area, and stack position
hd404358 series 12 functional description registers and flags the mcu has nine registers and two flags for cpu operations. they are shown in figure 7 and described below. 30 30 30 30 30 30 0 0 0 13 95 1 (b) (a) (w) (x) (y) (spx) (spy) (ca) (st) (pc) (sp) 1111 accumulator b register w register x register y register spx register spy register carry status program counter initial value: 0, no r/w stack pointer initial value: $3ff, no r/w 0 0 initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: undefined, r/w initial value: 1, no r/w figure 7 registers and flags accumulator (a), b register (b): four-bit registers used to hold the results from the arithmetic logic unit (alu) and transfer data between memory, i/o, and other registers. w register (w), x register (x), y register (y): two-bit (w) and four-bit (x and y) registers used for indirect ram addressing. the y register is also used for d-port addressing.
hd404358 series 13 spx register (spx), spy register (spy): four-bit registers used to supplement the x and y registers. carry flag (ca): one-bit flag that stores any alu overflow generated by an arithmetic operation. ca is affected by the sec, rec, rotl, and rotr instructions. a carry is pushed onto the stack during an interrupt and popped from the stack by the rtni instruction?ut not by the rtn instruction. status flag (st): one-bit flag that latches any overflow generated by an arithmetic or compare instruction, not-zero decision from the alu, or result of a bit test. st is used as a branch condition of the br, brl, cal, and call instructions. the contents of st remain unchanged until the next arithmetic, compare, or bit test instruction is executed, but become 1 after the br, brl, cal, or call instruction is read, regardless of whether the instruction is executed or skipped. the contents of st are pushed onto the stack during an interrupt and popped from the stack by the rtni instruction?ut not by the rtn instruction. program counter (pc): 14-bit binary counter that points to the rom address of the instruction being executed. stack pointer (sp): ten-bit pointer that contains the address of the stack area to be used next. the sp is initialized to $3ff by mcu reset. it is decremented by 4 when data is pushed onto the stack, and incremented by 4 when data is popped from the stack. the top four bits of the sp are fixed at 1111, so a stack can be used up to 16 levels. the sp can be initialized to $3ff in another way: by resetting the rsp bit with the rem or remd instruction. reset the mcu is reset by inputting a high-level voltage to the reset pin. at power-on or when stop mode is cancelled, reset must be high for at least one t rc to enable the oscillator to stabilize. during operation, reset must be high for at least two instruction cycles. initial values after mcu reset are listed in table 1. interrupts the mcu has 7 interrupt sources: two external signals ( int 0 and int 1 ), three timer/counters (timers a, b, and c), serial interface, and a/d converter. an interrupt request flag (if), interrupt mask (im), and vector address are provided for each interrupt source, and an interrupt enable flag (ie) controls the entire interrupt process. interrupt control bits and interrupt processing: locations $000 to $003 in ram are reserved for the interrupt control bits which can be accessed by ram bit manipulation instructions. the interrupt request flag (if) cannot be set by software. mcu reset initializes the interrupt enable flag (ie) and the if to 0 and the interrupt mask (im) to 1. a block diagram of the interrupt control circuit is shown in figure 8, interrupt priorities and vector addresses are listed in table 2, and interrupt processing conditions for the 7 interrupt sources are listed in table 3.
hd404358 series 14 an interrupt request occurs when the if is set to 1 and the im is set to 0. if the ie is 1 at that point, the interrupt is processed. a priority programmable logic array (pla) generates the vector address assigned to that interrupt source. the interrupt processing sequence is shown in figure 9 and an interrupt processing flowchart is shown in figure 10. after an interrupt is acknowledged, the previous instruction is completed in the first cycle. the ie is reset in the second cycle, the carry, status, and program counter values are pushed onto the stack during the second and third cycles, and the program jumps to the vector address to execute the instruction in the third cycle. program the jmpl instruction at each vector address, to branch the program to the start address of the interrupt program, and reset the if by a software instruction within the interrupt program.
hd404358 series 15 table 1 initial values after mcu reset item abbr. initial value contents program counter (pc) $0000 indicates program execution point from start address of rom area status flag (st) 1 enables conditional branching stack pointer (sp) $3ff stack level 0 interrupt flags/mask interrupt enable flag (ie) 0 inhibits all interrupts interrupt request flag (if) 0 indicates there is no interrupt request interrupt mask (im) 1 prevents (masks) interrupt requests i/o port data register (pdr) all bits 1 enables output at level 1 data control register (dcd0 dcd1) all bits 0 turns output buffer off (to high impedance) (dcd2) - - - 0 (dcr0 dcr4, dcr8) all bits 0 port mode register a (pmra) 0000 refer to description of port mode register a port mode register b bits 2? (pmrb2 pmrb0) 000 refer to description of port mode register b port mode register c (pmrc) 00 - 0 refer to description of port mode register c timer/ counters, serial interface timer mode register a (tma) - 000 refer to description of timer mode register a timer mode register b1 (tmb1) 0000 refer to description of timer mode register b1 timer mode register b2 (tmb2) - 000 refer to description of timer mode register b2 timer mode register c (tmc) 0000 refer to description of timer mode register c serial mode register (smr) 0000 refer to description of serial mode register prescaler s (pss) $000 timer counter a (tca) $00 timer counter b (tcb) $00 timer counter c (tcc) $00 timer write register b (twbu, twbl) $x0 timer write register c (twcu, twcl) $x0 octal counter 000
hd404358 series 16 item abbr. initial value contents a/d a/d mode register 1 (amr1) 0000 refer to description of a/d mode register a/d mode register 2 (amr2) - - 00 a/d channel register (acr) - 000 refer to description of a/d channel register a/d data register (adrl) 0000 refer to description of a/d data register (adru) 1000 bit registers watchdog timer on flag (wdon) 0 refer to description of timer c a/d start flag (adsf) 0 refer to description of a/d converter i ad off flag (iaof) 0 refer to the description of a/d converter input capture status flag (icsf) 0 refer to description of timer b input capture error flag (icef) 0 refer to description of timer b others miscellaneous register (mis) 00 - - refer to description of operati ng modes, i/o, and serial interface notes: 1. the statuses of other registers and flags after mcu reset are shown in the following table. 2. x indicates invalid value. ?indicates that the bit does not exist. item abbr. status after cancellation of stop mode by stopc input status after all other types of reset carry flag (ca) pre-stop-mode values are not guaranteed; values must be initialized by program pre-mcu-reset values are not guaranteed; values must be initialized by program accumulator (a) b register (b) w register (w) x/spx register (x/spx) y/spy register (y/spy) serial data register (srl, sru) ram pre-stop-mode values are retained ram enable flag (rame) 1 0 port mode register b bit 3 (pmrb3) pre-stop-mode values are retained 0
hd404358 series 17 table 2 vector addresses and interrupt priorities reset/interrupt priority vector address reset , stopc * $0000 int 0 1 $0002 int 1 2 $0004 timer a 3 $0006 timer b 4 $0008 timer c 5 $000a a/d 6 $000c serial 7 $000e note: * the stopc interrupt request is valid only in stop mode.
hd404358 series 18 ie ifo imo if1 im1 ifta imta iftb imtb iftc imtc ifad imad $ 000,0 $ 000,2 $ 000,3 $ 001,0 $ 001,1 $ 001,2 $ 001,3 $ 002,0 $ 002,1 $ 002,2 $ 002,3 $ 003,0 $ 003,1 sequence control ?push pc/ca/st ?reset ie ?jump to vector address priority control logic vector address note: $m,n is ram address $m, bit number n. ifs ims $ 003,2 $ 003,3 int 0 interrupt int 1 interrupt timer a interrupt timer b interrupt timer c interrupt a/d interrupt serial interrupt figure 8 interrupt control circuit
hd404358 series 19 table 3 interrupt processing and activation conditions interrupt source int 0 int 1 timer a timer b timer c a/d serial ie 11 11 11 1 if0 im0 10 00 00 0 if1 im1 * 100000 ifta imta ** 10 00 0 iftb imtb ** * 1000 iftc ? imtc ** ** 10 0 ifad imad ** ** * 10 ifs ims ** ** ** 1 note: bits marked * can be either 0 or 1. their values have no effect on operation. instruction cycles 123456 instruction execution * ie reset interrupt acceptance execution of jmpl instruction at vector address execution of instruction at start address of interrupt routine vector address generation note: * the stack is accessed and the ie reset after the instruction is executed, even if it is a two-cycle instruction. stacking figure 9 interrupt processing sequence
hd404358 series 20 power on reset = 0? reset mcu interrupt request? execute instruction pc (pc) + 1 ? pc $0002 ? pc $0004 ? pc $0006 ? pc $0008 ? pc $000a ? pc $000e ? ie = 1? accept interrupt ie 0 stack (pc) stack (ca) stack (st) ? int 0 interrupt? int 1 interrupt? timer-a interrupt? timer-b interrupt? no yes no yes no yes yes yes yes yes yes no no no no ? ? ? (serial interrupt) pc $000c ? a/d interrupt? yes no no timer-c interrupt? figure 10 interrupt processing flowchart
hd404358 series 21 interrupt enable flag (ie: $000, bit 0): controls the entire interrupt process. it is reset by the interrupt processing and set by the rtni instruction, as listed in table 4. table 4 interrupt enable flag (ie: $000, bit 0) ie interrupt enabled/disabled 0 disabled 1 enabled external interrupts ( int 0 , int 1 ): two external interrupt signals. external interrupt request flags (if0: $000, bit 2; if1: $001, bit 0): if0 and if1 are set at the rising edge of signals input to int 0 and int 1 , as listed in table 5. table 5 external interrupt request flags (if0: $000, bit2; if1: $001, bit 0) if0, if1 interrupt request 0no 1 yes external interrupt masks (im0: $000, bit 3; im1: $001, bit 1): prevent (mask) interrupt requests caused by the corresponding external interrupt request flags, as listed in table 6. table 6 external interrupt masks (im0: $000, bit 3; im1: $001, bit 1) im0, im1 interrupt request 0 enabled 1 disabled (masked) timer a interrupt request flag (ifta: $001, bit 2): set by overflow output from timer a, as listed in table 7. table 7 timer a interrupt request flag (ifta: $001, bit 2) ifta interrupt request 0no 1 yes timer a interrupt mask (imta: $001, bit 3): prevents (masks) an interrupt request caused by the timer a interrupt request flag, as listed in table 8.
hd404358 series 22 table 8 timer a interrupt mask (imta: $001, bit 3) imta interrupt request 0 enabled 1 disabled (masked) timer b interrupt request flag (iftb: $002, bit 0): set by overflow output from timer b, as listed in table 9. table 9 timer b interrupt request flag (iftb: $002, bit 0) iftb interrupt request 0no 1 yes timer b interrupt mask (imtb: $002, bit 1): prevents (masks) an interrupt request caused by the timer b interrupt request flag, as listed in table 10. table 10 timer b interrupt mask (imtb: $002, bit 1) imtb interrupt request 0 enabled 1 disabled (masked) timer c interrupt request flag (iftc: $002, bit 2): set by overflow output from timer c, as listed in table 11. table 11 timer c interrupt request flag (iftc: $002, bit 2) iftc interrupt request 0no 1 yes timer c interrupt mask (imtc: $002, bit 3): prevents (masks) an interrupt request caused by the timer c interrupt request flag, as listed in table 12. table 12 timer c interrupt mask (imtc: $002, bit 3) imtc interrupt request 0 enabled 1 disabled (masked)
hd404358 series 23 serial interrupt request flag (ifs: $003, bit 2): set when data transfer is completed or when data transfer is suspended, as listed in table 13. table 13 serial interrupt request flag (ifs: $003, bit 2) ifs interrupt request 0no 1 yes serial interrupt mask (ims: $003, bit 3): prevents (masks) an interrupt request caused by the serial interrupt request flag, as listed in table 14. table 14 serial interrupt mask (ims: $003, bit 3) mask ims interrupt request 0 enabled 1 disabled (masked) a/d interrupt request flag (ifad: $003, bit 0): set at the completion of a/d conversion, as listed in table 15. table 15 a/d interrupt request flag (ifad: $003, bit 0) ifad interrupt request 0no 1 yes a/d interrupt mask (imad: $003, bit 1): prevents (masks) an interrupt request caused by the a/d interrupt request flag, as listed in table 16. table 16 a/d interrupt mask (imad: $003, bit 1) imad interrupt request 0 enabled 1 disabled (masked)
hd404358 series 24 operating modes the mcu has three operating modes as shown in table 17. the operations in each mode are listed in tables 18 and 19. transitions between operating modes are shown in figure 11. table 17 operating modes and clock status mode name active standby stop activation method reset cancellation, interrupt request, stopc cancellation in stop mode sby instruction stop instruction status system oscillator op op stopped cancellation method reset input, stop/ sby instruction reset input, interrupt request reset input, stopc input in stop mode note: op implies in operation table 18 operations in low-power dissipation modes function stop mode standby mode cpu reset retained ram retained retained timer a reset op timer b reset op timer c reset op serial reset op a/d reset op i/o reset retained note: op implies in operation table 19 i/o status in low-power dissipation modes output input standby mode stop mode active mode ra 1 input enabled r 0 ? 8 , r0?4, r8, retained or output of peripheral functions high impedance input enabled
hd404358 series 25 reset by reset input or by watchdog timer standby mode stop mode sby instruction interrupt active mode reset 1 reset 2 rame = 0 rame = 1 stop instruction stopc oscillate stop f cyc f osc : cpu : per : oscillate f cyc f cyc f osc : cpu : per : stop stop stop f osc : cpu : per : main oscillation frequency f osc /4 system clock clock for other peripheral functions f osc : f cyc : cpu : per : figure 11 mcu status transitions active mode: all mcu functions operate according to the clock generated by the system oscillator osc 1 and osc 2 . standby mode: in standby mode, the oscillators continue to operate, but the clocks related to instruction execution stop. therefore, the cpu operation stops, but all ram and register contents are retained, and the d or r port status, when set to output, is maintained. peripheral functions such as interrupts, timers, and serial interface continue to operate. the power dissipation in this mode is lower than in active mode because the cpu stops. the mcu enters standby mode when the sby instruction is executed in active mode. standby mode is terminated by a reset input or an interrupt request. if it is terminated by reset input, the mcu is reset as well. after an interrupt request, the mcu enters active mode and executes the next instruction after the sby instruction. if the interrupt enable flag is 1, the interrupt is then processed; if it is 0, the interrupt request is left pending and normal instruction execution continues. a flowchart of operation in standby mode is shown in figure 12.
hd404358 series 26 standby oscillator: active peripheral clocks: active all other clocks: stop no yes no yes no yes no yes no yes no yes yes restart processor clocks reset mcu execute next instruction accept interrupt restart processor clocks no yes if = 1, im = 0, and ie = 1? reset = 0? if0 ? imo = 1? if1 ? im1 = 1? ifta ? imta = 1? iftb ? imtb = 1? iftc ? imtc = 1? ifad ? imad = 1? no yes ifs ? ims = 1? no stop oscillator: stop peripheral clocks: stop all other clocks: stop reset = 0? stopc = 0? rame = 1 rame = 0 yes yes no no execute next instruction figure 12 mcu operation flowchart stop mode: in stop mode, all mcu operations stop and ram data is retained. therefore, the power dissipation in this mode is the least of all modes. the osc 1 and osc 2 oscillator stops. stop mode is terminated by a reset input or a stopc input as shown in figure 13. reset or stopc must be applied for at least one t rc to stabilize oscillation (refer to the ac characteristics section). when the mcu restarts after stop mode is cancelled, all ram contents before entering stop mode are retained, but the accuracy of the contents of the accumulator, b register, w register, x/spx register, y/spy register, carry flag, and serial data register cannot be guaranteed.
hd404358 series 27                stop mode oscillator internal clock stop instruction execution t res 3 t rc (stabilization period) t res       reset or stopc figure 13 timing of stop mode cancellation stop mode cancellation by stopc : the mcu enters active mode from stop mode by inputting stopc as well as by r e se t . in either case, the mcu starts instruction execution from the starting address (address 0) of the program. however, the value of the ram enable flag (rame: $021, bit 3) differs between cancellation by stopc and by reset . when stop mode is cancelled by r e se t , rame = 0; when cancelled by stopc , rame = 1. reset can cancel all modes, but stopc is valid only in stop mode; stopc input is ignored in other modes. therefore, when the program requires to confirm that stop mode has been cancelled by stopc (for example, when the ram contents before entering stop mode is used after transition to active mode), execute the test instruction to the ram enable flag (rame) at the beginning of the program. mcu operation sequence: the mcu operates in the sequence shown in figure 15. it is reset by an asynchronous reset input, regardless of its status. the low-power mode operation sequence is shown in figure 16. with the ie flag cleared and an interrupt flag set together with its interrupt mask cleared, if a stop/sby instruction is executed, the instruction is cancelled (regarded as an nop) and the following instruction is executed. before executing a stop/sby instruction, make sure all interrupt flags are cleared or all interrupts are masked. power on reset = 0 ? rame = 0 reset mcu mcu operation cycle no yes figure 14 mcu operating sequence (power on)
hd404358 series 28 mcu operation cycle if = 1? instruction execution sby/stop instruction? pc next location pc vector address low-power mode operation cycle ie 0 stack (pc), (ca), (st) im = 0 and ie = 1? ? ? ? yes no no yes yes no if: im: ie: pc: ca: st: ? interrupt request flag interrupt mask interrupt enable flag program counter carry flag status flag figure 15 mcu operating sequence (mcu operation cycle)
hd404358 series 29 low-power mode operation cycle if = 1 and im = 0? hardware nop execution ? pc next iocation mcu operation cycle standby mode if = 1 and im = 0? hardware nop execution pc next iocation ? instruction execution stop mode no yes no yes for if and im operation, refer to figure 12. stopc = 0? rame = 1 reset mcu no yes figure 16 mcu operating sequence (low-power mode operation)
hd404358 series 30 internal oscillator circuit a block diagram of the clock generation circuit is shown in figure 17. as shown in table 20, a ceramic oscillator or crystal oscillator can be connected to osc 1 and osc 2 . the system oscillator can also be operated by an external clock. see figure 18 for the layout of crystal and ceramic oscillator. osc 2 osc 1 system oscillator 1/4 division circuit timing generator circuit cpu with rom, ram, registers, flags, and i/o peripheral function interrupt f cyc t cyc f osc cpu per figure 17 clock generation circuit osc 2 gnd osc 1 test reset av ss figure 18 typical layout of crystal and ceramic oscillator
hd404358 series 31 table 20 oscillator circuit examples circuit configuration circuit constants external clock operation external oscillator osc open 1 osc 2 ceramic oscillator (osc 1 , osc 2 ) osc 2 c 1 2 c osc 1 r f ceramic gnd ceramic oscillator: csa4.00mg (murata) r f = 1 m w 20% c 1 = c 2 = 30 pf 20% crystal oscillator (osc 1 , osc 2 ) osc 2 c 1 2 c osc 1 r f crystal gnd l s c r s c o osc 1 osc 2 r f = 1 m w 20% c 1 = c 2 = 10 to 22 pf 20% crystal: equivalent to circuit shown below c 0 = 7 pf max. r s = 100 w max. notes: 1. since the circuit constants change depending on the crystal or ceramic oscillator and stray capacitance of the board, the user should consult with the crystal or ceramic oscillator manufacturer to determine the circuit parameters. 2. wiring among osc 1 , osc 2 , and elements should be as short as possible, and must not cross other wiring (see figure 18).
hd404358 series 32 input/output the mcu has 33 input/output pins (d 0 ? 8 , r0?4, r8) and an input pin (ra 1 ). the features are described below. four pins (r2 0 ?2 3 ) are high-current (15 ma max) input/output with intermediate voltage nmos open drain pins. the d 0 ? 4 , r0, r3?4 input/output pins are multiplexed with peripheral function pins such as for the timers or serial interface. for these pins, the peripheral function setting is done prior to the d or r port setting. therefore, when a peripheral function is selected for a pin, the pin function and input/output selection are automatically switched according to the setting. input or output selection for input/output pins and port or peripheral function selection for multiplexed pins are set by software. peripheral function output pins are cmos output pins. only the r0 2 /so pin can be set to nmos open- drain output by software. in stop mode, the mcu is reset, and therefore peripheral function selection is cancelled. input/output pins are in high-impedance state. each input/output pin except for r2 has a built-in pull-up mos, which can be individually turned on or off by software. i/o buffer configuration is shown in figure 19, programmable i/o circuits are listed in table 21, and i/o pin circuit types are shown in table 22. table 21 programmable i/o circuits mis3 (bit 3 of mis) 0 1 dcd, dcr 0 1 0 1 pdr 0101 010 1 cmos buffer pmos ?n on nmos on on pull-up mos ?n on note: ?indicates off status.
hd404358 series 33 mis3 input control signal v cc pull-up mos dcd, dcr pdr input data v cc hlt pull-up control signal buffer control signal output data figure 19 i/o buffer configuration
hd404358 series 34 table 22 circuit configurations of i/o pins i/o pin type circuit pins input/output pins v cc v cc pull-up control signal buffer control signal output data input data hlt mis3 pdr input control signal dcr, dcd d 0 ? 8 , r0 0 , r0 1 , r0 3 r1 0 ?1 3 , r3 0 ?3 3 , r4 0 ?4 3 , r8 0 ?8 3 v cc v cc pull-up control signal buffer control signal output data input data hlt mis3 dcr pdr input control signal mis2 r0 2 hlt dcr pdr input data output data input control signal r2 0 ?2 3 input pins input data input control signal ra 1 peripheral function pins input/output pins v cc v cc pull-up control signal output data input data hlt mis3 sck sck sck notes on next page.
hd404358 series 35 i/o pin type circuit pins peripheral function pins output pins v cc v cc pull-up control signal pmos control signal output data hlt mis3 so mis2 so v cc v cc pull-up control signal output data hlt mis3 toc, buzz toc, buzz input pins input data v cc hlt mis3 pdr si, int 0 , int 1 , evnb, stopc a/d input input control signal v cc hlt mis3 pdr an 0 ?n 7 notes: 1. in stop mode, the mcu is reset and the peripheral function selection is cancelled. the hlt signal goes low, and input/output pins enter the high-impedance state. 2. the hlt signal is 1 in active and standby modes.
hd404358 series 36 evaluation chip set and ztat ? /mask rom product differences as shown in figure 20, the nmos intermediate breakdown voltage open drain pin circuit in the evaluation chip set differs from that used in the ztat ? microcomputer and built-in mask rom microcomputer products. please note that although these outputs in the ztat ? microcomputer and built-in mask rom microcomputer products can be set to high impedance by the combinations shown in table 23, these outputs cannot be set to high impedance in the evaluation chip set. table 23 program control of high impedance states register set value dcr 0 1 pdr * 1 notes: * an asterisk indicates that the value may be either 0 or 1 and has no influence on circuit operation. this applies to the ztat ? and built-in mask rom microcomputer nmos open drain pins. v cc v cc hlt mis3 dcr pdr cpu input input control signal evaluation chip set circuit structure input control signal ztat and built-in mask rom microcomputer circuit structure hlt dcr pdr cpu input ? figure 20 nmos intermediate breakdown voltage open drain pin circuits
hd404358 series 37 d port (d 0 ? 8 ): consist of 9 input/output pins addressed by one bit. pins d 0 ? 8 are set by the sed and sedd instructions, and reset by the red and redd instructions. output data is stored in the port data register (pdr) for each pin. all pins d 0 ? 8 are tested by the td and tdd instructions. the on/off statuses of the output buffers are cont rol l ed by d-port dat a control regis t ers (dc d0dc d2: $02c $02e) that are mapped to memory addresses (figure 21). pins d0?2, d4 are multiplexed with peripheral function pins int0 , int1 , evnb, and stopc , respectively. the peripheral function modes of these pins are selected by bits 0? (pmrb0?mrb3) of port mode register b (pmrb: $024) (figure 22). pin d 3 is multiplexed with peripheral function pin buzz. the peripheral function mode of this pin is selected by bit 3 (pmra3) of port mode register a (pmra: $004) (figure 23). r ports (r0 0 ?4 3 , r8): 24 input/output pins addressed in 4-bit units. data is input to these ports by the lar and lbr instructions, and output from them by the lra and lrb instructions. output data is stored in the port data register (pdr) for each pin. the on/off statuses of the output buffers of the r ports are controlled by r-port data control registers (dcr0?cr4: $030?034, dcr8: $038) that are mapped to memory addresses (figure 21). pin r0 0 is multiplexed with peripheral function pin sck . the peripheral function mode of this pin is selected by bit 3 (smr3) of serial mode register (smr: $005) (figure 24). pins r0 1 ?0 3 are multiplexed with peripheral pins si, so and toc, respectively. the peripheral function modes of these pins are selected by bits 0? (pmra0?mra2) of port mode register a (pmra: $004), as shown in figures 23. port r3 is multiplexed with peripheral function pins an 0 ?n 3 , respectively. the peripheral function modes of these pins can be selected by individual pins, by setting a/d mode register 1 (amr1: $019) (figure 25). ports r4 is multiplexed with peripheral function pins an 4 ?n 7 , respectively. the peripheral function modes of these pins can be selected in 4-pin units by setting bit 1 (amr21) of a/d mode register 2 (amr2: $01a) (figure 26). pull-up mos transistor control: a program-controlled pull-up mos transistor is provided for each input/output pin. the on/off status of all these transistors is controlled by bit 3 (mis3) of the miscellaneous register (mis: $00c), and the on/off status of an individual transistor can also be controlled by the port data register (pdr) of the corresponding pin?nabling on/off control of that pin alone (table 21 and figure 27). the on/off status of each transistor and the peripheral function mode of each pin can be set independently. how to deal with unused i/o pins: i/o pins that are not needed by the user system (floating) must be connected to v cc to prevent lsi malfunctions due to noise. these pins must either be pulled up to v cc by their pull-up mos transistors or by resistors of about 100 k w .
hd404358 series 38 bit initial value read/write bit name 3 0 w 2 0 w 0 0 w 1 0 w dcd0, dcd2, dcr0 to dcr4, dcr8 data control register (dcd0 to 2: $02c to $02e) (dcr0 to 4: $030 to $034, dcr8: $038) correspondence between ports and dcd/dcr bits 0 1 dcd0 dcd1 dcd2 dcr0 dcr1 dcr2 dcr3 dcr4 dcr8 off (high-impedance) on bits 0 to 3 cmos buffer on/off selection register name d 3 d 7 not used r0 3 r1 3 r2 3 r3 3 r4 3 r8 3 bit 3 d 2 d 6 not used r0 2 r1 2 r2 2 r3 2 r4 2 r8 2 bit 2 d 1 d 5 not used r0 1 r1 1 r2 1 r3 1 r4 1 r8 1 bit 1 d 0 d 4 d 8 r0 0 r1 0 r2 0 r3 0 r4 0 r8 0 bit 0 dcd03, dcd13, dcr03 dcr43, dcr83 dcd02, dcd12, dcr02 dcr42, dcr82 dcd01, dcd11, dcr01 dcr41, dcr81 dcd00 dcd20, dcr00 dcr40, dcr80 figure 21 data control registers (dcd, dcr)
hd404358 series 39 bit initial value read/write bit name 3 0 w pmrb3 2 0 w pmrb2 0 0 w pmrb0 1 0 w pmrb1 pmrb0 0 1 d 0 / int 0 mode selection d 0 int 0 port mode register b (pmrb: $024) pmrb1 0 1 d 1 / int 1 mode selection d 1 int 1 pmrb2 0 1 d 2 /evnb mode selection d 2 evnb pmrb3 0 1 d 4 / stopc mode selection d 4 stopc * note: pmrb3 is reset to 0 only by reset input. when stopc is input in stop mode, pmrb3 is not reset but retains its value. * figure 22 port mode register b (pmrb) bit initial value read/write bit name 3 0 w pmra3 2 0 w pmra2 0 0 w pmra0 1 0 w pmra1 pmra0 0 1 r0 2 /so mode selection r0 2 so port mode register a (pmra: $004) pmra1 0 1 r0 1 /si mode selection r0 1 si pmra2 0 1 r0 3 /toc mode selection r0 3 toc pmra3 0 1 d 3 /buzz mode selection d 3 buzz figure 23 port mode register a (pmra)
hd404358 series 40 bit initial value read/write bit name 3 0 w smr3 2 0 w smr2 0 0 w smr0 1 0 w smr1 serial mode register (smr: $005) smr2 smr0 smr1 smr3 0 1 r0 0 / sck mode selection r0 0 sck transmit clock selection. refer to figure 55 in the serial interface section. figure 24 serial mode register (smr) bit initial value read/write bit name 3 0 w amr13 2 0 w amr12 0 0 w amr10 1 0 w amr11 amr10 0 1 an 0 a/d mode register 1 (amr1: $019) amr11 0 1 an 1 amr12 0 1 r3 2 /an 2 mode selection r3 2 an 2 amr13 0 1 r3 3 /an 3 mode selection r3 3 an 3 r3 0 /an 0 mode selection r3 0 r3 1 /an 1 mode selection r3 1 figure 25 a/d mode register 1 (amr1)
hd404358 series 41 bit initial value read/write bit name 3 not used 2 not used 0 0 w amr20 1 0 w amr21 amr20 0 1 67 t cyc a/d mode register 2 (amr2: $01a) amr21 0 1 an 4 ?n 7 conversion time 34 t cyc r4/an 4 ?n 7 pin selection r4 figure 26 a/d mode register 2 (amr2) bit initial value read/write bit name 3 0 w mis3 2 0 w mis2 0 not used 1 not used mis2 cmos buffer on/off selection for pin r0 2 /so miscellaneous register (mis: $00c) 0 1 pmos active pmos off mis3 0 1 pull-up mos on/off selection pull-up mos off pull-up mos on (refer to table 21) figure 27 miscellaneous register (mis)
hd404358 series 42 prescalers the mcu has a built-in prescaler labeled as prescaler s (pss). the prescalers operating conditions are listed in table 24, and the prescalers output supply is shown in figure 28. the timers a? input clocks except external events, the serial transmit clock except the external clock are selected from the prescaler outputs, depending on corresponding mode registers. prescaler operation prescaler s: 11-bit counter that inputs the system clock signal. after being reset to $000 by mcu reset, prescaler s divides the system clock. table 24 prescaler operating conditions prescaler input clock reset conditions stop conditions prescaler s system clock mcu reset mcu reset, stop mode timer a timer b timer c serial system clock prescaler s clock selector alarm output circuit figure 28 prescaler output supply
hd404358 series 43 timers the mcu has four timer/counters (a to c). timer a: free-running timer timer b: multifunction timer timer c: multifunction timer timer a is an 8-bit free-running timer. timers b and c are 8-bit multifunction timers, whose functions are listed in table 25. the operating modes are selected by software. table 25 timer functions functions timer a timer b timer c clock source prescaler s available available available external event available timer functions free-running available available available event counter available reload available available watchdog available input capture available timer output pwm available note: ?implies not available.
hd404358 series 44 timer a timer a functions: timer a has the following functions. free-running timer the block diagram of timer a is shown in figure 29. system clock selector prescaler s (pss) internal data bus timer a interrupt request flag (ifta) overflow timer counter a (tca) timer mode register a (tma) 3 per 2 4 8 32 128 512 1024 2048 ? ? ? ? ? ? ? ? clock figure 29 timer a block diagram timer a operations: free-running timer operation: the input clock for timer a is selected by timer mode register a (tma: $008). timer a is reset to $00 by mcu reset and incremented at each input clock. if an input clock is applied to timer a after it has reached $ff, an overflow is generated, and timer a is reset to $00. the overflow sets the timer a interrupt request flag (ifta: $001, bit 2). timer a continues to be incremented after reset to $00, and therefore it generates regular interrupts every 256 clocks. registers for timer a operation: timer a operating modes are set by the following registers. timer mode register a (tma: $008): four-bit write-only register that selects timer a? operating mode and input clock source as shown in figure 30.
hd404358 series 45 bit initial value read/write bit name 3 not used 2 0 w tma2 0 0 w tma0 1 0 w tma1 timer mode register a (tma: $008) 0 0 1 0 1 0 1 0 1 0 1 pss pss pss pss pss pss pss pss tma1 tma2 tma0 source prescaler input clock frequency 0 1 1 2048t cyc 1024t cyc 512t cyc 128t cyc 32t cyc 8t cyc 4t cyc 2t cyc figure 30 timer mode register a (tma)
hd404358 series 46 timer b timer b functions: timer b has the following functions. free-running/reload timer external event counter input capture timer the block diagram for each operation mode of timer b is shown in figures 31 and 32. timer counter b (tcb) ? ? ? ? ? ? ? 2 4 8 32 128 512 2048 timer mode register b2 (tmb2) evnb selector system clock per prescaler s (pss) 2 edge detector edge detection control signal 3 timer write register b lower (twbl) timer mode register b1 (tmb1) timer write register b upper (twbu) clock free-running timer control signal timer read register b lower (trbl) interrupt request flag of timer b (iftb) timer read register b upper (trbu) overflow internal data bus figure 31 timer b free-running and reload operation block diagram
hd404358 series 47 timer counter b (tcb) internal data bus timer mode register b2 (tmb2) evnb selector system clock prescaler s (pss) 2 edge detector edge detection control signal 3 timer mode register b1 (tmb1) clock input capture timer control signal timer read register b lower (trbl) interrupt request flag of timer b (iftb) timer read register b upper (trbu) overflow read signal input capture status flag (icsf) input capture error flag (icef) error controller ? ? ? ? ? ? ? 2 4 8 32 128 512 2048 per figure 32 timer b input capture operation block diagram
hd404358 series 48 timer b operations: free-running/reload timer operation: the free-running/reload operation, input clock source, and prescaler division ratio are selected by timer mode register b1 (tmb1: $009). timer b is initialized to the value set in timer write register b (twbl: $00a, twbu: $00b) by software and incremented by one at each clock input. if an input clock is applied to timer b after it has reached $ff, an overflow is generated. in this case, if the reload timer function is enabled, timer b is initialized to its initial value set in timer write register b; if the free-running timer function is enabled, the timer is initialized to $00 and then incremented again. the overflow sets the timer b interrupt request flag (iftb: $002, bit 0). iftb is reset by software or mcu reset. refer to figure 3 and table 1 for details. external event counter operation: timer b is used as an external event counter by selecting the external event input as an input clock source. in this case, pin d 2 /evnb must be set to evnb by port mode register b (pmrb: $024). either falling or rising edge, or both falling and rising edges of input signals can be selected as the external event detection edge by timer mode register 2 (tmb2: $026). when both rising and falling edges detection is selected, the time between the falling edge and rising edge of input signals must be 2t cyc or longer. timer b is incremented by one at each detection edge selected by timer mode register 2 (tmb2: $026). the other operation is basically the same as the free-running/reload timer operation. input capture timer operation: the input capture timer counts the clock cycles between trigger edges input to pin evnb. either falling or rising edge, or both falling and rising edges of input signals can be selected as the trigger input edge by timer mode register 2 (tmb2: $026). when a trigger edge is input to evnb, the count of timer b is written to timer read register b (trbl: $00a, trbu: $00b), and the timer b interrupt request flag (iftb: $002, bit 0) and the input capture status flag (icsf: $021, bit 0) are set. timer b is reset to $00, and then incremented again. while icsf is set, if a trigger input edge is applied to timer b, or if timer b generates an overflow, the input capture error flag (icef: $021, bit 1) is set. icsf and icef are reset to 0 by mcu reset or by writing 0. registers for timer b operation: by using the following registers, timer b operation modes are selected and the timer b count is read and written. timer mode register b1 (tmb1: $009) timer mode register b2 (tmb2: $026) timer write register b (twbl: $00a, twbu: $00b) timer read register b (trbl: $00a, trbu: $00b) port mode register b (pmrb: $024) timer mode register b1 (tmb1: $009): four-bit write-only register that selects the free-running/reload timer function, input clock source, and the prescaler division ratio as shown in figure 33. it is reset to $0 by mcu reset.
hd404358 series 49 writing to this register is valid from the second instruction execution cycle after the execution of the previous timer mode register b1 write instruction. setting timer b? initialization by writing to timer write register b (twbl: $00a, twbu: $00b) must be done after a mode change becomes valid. when selecting the input capture timer operation, select the internal clock as the input clock source. bit initial value read/write bit name 3 0 w tmb13 2 0 w tmb12 0 0 w tmb10 1 0 w tmb11 timer mode register b1 (tmb1: $009) 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2048t cyc 512t cyc 128t cyc 32t cyc 8t cyc 4t cyc 2t cyc tmb12 tmb10 tmb11 input clock period and input clock source d 2 /evnb (external event input) tmb13 0 1 free-running/reload timer selection free-running timer reload timer figure 33 timer mode register b1 (tmb1)
hd404358 series 50 timer mode register b2 (tmb2: $026): three-bit write-only register that selects the detection edge of signals input to pin evnb and input capture operation as shown in figure 34. it is reset to $0 by mcu reset. bit initial value read/write bit name 3 not used 2 0 w tmb22 0 0 w tmb20 1 0 w tmb21 timer mode register b2 (tmb2: $026) tmb21 0 1 tmb20 0 1 0 1 evnb edge detection selection no detection falling edge detection rising edge detection rising and falling edge detection tmb22 0 1 free-running/reload and input capture selection free-running/reload input capture figure 34 timer mode register b2 (tmb2) timer write register b (twbl: $00a, twbu: $00b): write-only register consisting of the lower digit (twbl) and the upper digit (twbu). the lower digit is reset to $0 by mcu reset, but the upper digit value is invalid (figures 35 and 36). timer b is initialized by writing to timer write register b (twbl: $00a, twbu: $00b). in this case, the lower digit (twbl) must be written to first, but writing only to the lower digit does not change the timer b value. timer b is initialized to the value in timer write register b at the same time the upper digit (twbu) is written to. when timer write register b is written to again and if the lower digit value needs no change, writing only to the upper digit initializes timer b. bit initial value read/write bit name 3 0 w twbl3 2 0 w twbl2 0 0 w twbl0 1 0 w twbl1 timer write register b (lower digit) (twbl: $00a) figure 35 timer write register b lower digit (twbl)
hd404358 series 51 bit initial value read/write bit name 3 undefined w twbu3 2 undefined w twbu2 0 undefined w twbu0 1 undefined w twbu1 timer write register b (upper digit) (twbu: $00b) figure 36 timer write register b upper digit (twbu) timer read register b (trbl: $00a, trbu: $00b): read-only register consisting of the lower digit (trbl) and the upper digit (trbu) that holds the count of the timer b upper digit (figures 37 and 38). the upper digit (trbu) must be read first. at this time, the count of the timer b upper digit is obtained, and the count of the timer b lower digit is latched to the lower digit (trbl). after this, by reading trbl, the count of timer b when trbu is read can be obtained. when the input capture timer operation is selected and if the count of timer b is read after a trigger is input, either the lower or upper digit can be read first. bit initial value read/write bit name 3 undefined r trbl3 2 undefined r trbl2 0 undefined r trbl0 1 undefined r trbl1 timer read register b (lower digit) (trbl: $00a) figure 37 timer read register b lower digit (trbl) bit initial value read/write bit name 3 undefined r trbu3 2 undefined r trbu2 0 undefined r trbu0 1 undefined r trbu1 timer read register b (upper digit) (trbu: $00b) figure 38 timer read register b upper digit (trbu)
hd404358 series 52 port mode register b (pmrb: $024): write-only register that selects d 2 /evnb pin function as shown in figure 39. it is reset to $0 by mcu reset. bit initial value read/write bit name 3 0 w pmrb3 2 0 w pmrb2 0 0 w pmrb0 1 0 w pmrb1 pmrb0 0 1 d 0 / int 0 mode selection d 0 int 0 port mode register b (pmrb: $024) pmrb1 0 1 d 1 / int 1 mode selection d 1 int 1 pmrb2 0 1 d 2 /evnb mode selection d 2 evnb pmrb3 0 1 d 4 / stopc mode selection d 4 stopc * note: pmrb3 is reset to 0 only by reset input. when stopc is input in stop mode, pmrb3 is not reset but retains its value. * figure 39 port mode register b (pmrb)
hd404358 series 53 timer c timer c functions: timer c has the following functions. free-running/reload timer watchdog timer timer output operation (pwm output) the block diagram of timer c is shown in figure 40. timer counter c (tcc) port mode register a (pmra) selector system clock prescaler s (pss) 3 timer write register c lower (twcl) timer mode register c (tmc) timer write register c upper (twcu) clock free-running timer control signal timer read register c lower (trcl) interrupt request flag of timer c (iftc) timer read register c upper (trcu) overflow toc timer output control signal watchdog timer controller watchdog on flag (wdon) system reset signal internal data bus timer output control logic ? ? ? ? ? ? ? ? 2 4 8 32 128 512 1024 2048 per figure 40 timer c block diagram
hd404358 series 54 timer c operations: free-running/reload timer operation: the free-running/reload operation, input clock source, and prescaler division ratio are selected by timer mode register c (tmc: $00d). timer c is initialized to the value set in timer write register c (twcl: $00e, twcu: $00f) by software and incremented by one at each clock input. if an input clock is applied to timer c after it has reached $ff, an overflow is generated. in this case, if the reload timer function is enabled, timer c is initialized to its initial value set in timer write register c; if the free-running timer function is enabled, the timer is initialized to $00 and then incremented again. the overflow sets the timer c interrupt request flag (iftc: $002, bit 2). iftc is reset by software or mcu reset. refer to figure 3 and table 1 for details. watchdog timer operation: timer c is used as a watchdog timer for detecting out-of-control program routines by setting the watchdog on flag (wdon: $020, bit 1) to 1. if a program routine runs out of control and an overflow is generated, the mcu is reset. the watchdog timer operation flowchart is shown in figure 41. program run can be controlled by initializing timer c by software before it reaches $ff. $ff + 1 $00 timer c count value overflow time cpu operation normal operation timer c clear normal operation timer c clear program runaway normal operation reset figure 41 watchdog timer operation flowchart timer output operation: the pwm output modes can be selected for timer c by setting port mode register a (pmra: $004). by selecting the timer output mode, pin r0 3 /toc is set to toc. the output from toc is reset low by mcu reset. pwm output: when pwm output mode is selected, timer c provides the variable-duty pulse output function. the output waveform differs depending on the contents of timer mode register c (tmc: $00d) and timer write register c (twcl: $00e, twcu: $00f). the output waveform is shown in figure 42.
hd404358 series 55 t (n + 1) t 256 t t (256 ?n) tmc3 = 0 (free-running timer) tmc3 = 1 (reload timer) notes: t: input clock period supplied to counter. (the clock source and system clock division n: value of timer write register c. (when n = 255 ($ff), pwm output is fixed low.) ratio are determined by timer mode register c.) figure 42 pwm output waveform notes on use when using the timer output as pwm output, note the following point. from the update of the timer write register until the occurrence of the overflow interrupt, the pwm output differs from the period and duty settings, as shown in table 26. the pwm output should therefore not be used until after the overflow interrupt following the update of the timer write register. after the overflow, the pwm output will have the set period and duty cycle. in this case, the lower digit (twcl) must be written to first, bit writing only to the lower digit does not change the timer c value. timer c is changed to the value in timer write register b at the same time the upper digit (twcu) is written to. table 26 pwm output following update of timer write register pwm output mode timer write register is updated during high pwm output timer write register is updated during low pwm output reload timer write register updated to value n interrupt request t t (255 ?n) t timer write register updated to value n interrupt request t t (255 ?n) t
hd404358 series 56 registers for timer c operation: by using the following registers, timer c operation modes are selected and the timer c count is read and written. timer mode register c (tmc: $00d) port mode register a (pmra: $004) timer write register c (twcl: $00e, twcu: $00f) timer read register c (trcl: $00e, trcu: $00f) timer mode register c (tmc: $00d): four-bit write-only register that selects the free-running/reload timer function, input clock source, and the prescaler division ratio as shown in figure 43. it is reset to $0 by mcu reset. writing to this register is valid from the second instruction execution cycle after the execution of the previous timer mode register c write instruction. setting timer c? initialization by writing to timer write register c (twcl: $00e, twcu: $00f) must be done after a mode change becomes valid. bit initial value read/write bit name 3 0 w tmc3 2 0 w tmc2 0 0 w tmc0 1 0 w tmc1 timer mode register c (tmc: $00d) 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2048t cyc 512t cyc 128t cyc 32t cyc 8t cyc 4t cyc 2t cyc tmc2 tmc0 tmc1 input clock period tmc3 0 1 free-running/reload timer selection free-running timer reload timer 1024t cyc figure 43 timer mode register c (tmc)
hd404358 series 57 port mode register a (pmra: $004): write-only register that selects r0 3 /toc pin function as shown in figure 44. it is reset to $0 by mcu reset. bit initial value read/write bit name 3 0 w pmra3 2 0 w pmra2 0 0 w pmra0 1 0 w pmra1 pmra0 0 1 r0 2 /so mode selection r0 2 so port mode register a (pmra: $004) pmra1 0 1 r0 1 /si mode selection r0 1 si pmra2 0 1 r0 3 /toc mode selection r0 3 toc pmra3 0 1 d 3 /buzz mode selection d 3 buzz figure 44 port mode register a (pmra) timer write register c (twcl: $00e, twcu: $00f): write-only register consisting of the lower digit (twcl) and the upper digit (twcu) as shown in figures 45 and 46. the operation of timer write register c is basically the same as that of timer write register b (twbl: $00a, twbu: $00b). bit initial value read/write bit name 3 0 w twcl3 2 0 w twcl2 0 0 w twcl0 1 0 w twcl1 timer write register c (lower digit) (twcl: $00e) figure 45 timer write register c lower digit (twcl) bit initial value read/write bit name 3 undefined w twcu3 2 undefined w twcu2 0 undefined w twcu0 1 undefined w twcu1 timer write register c (upper digit) (twcu: $00f) figure 46 timer write register c upper digit (twcu)
hd404358 series 58 timer read register c (trcl: $00e, trcu: $00f): read-only register consisting of the lower digit (trcl) and the upper digit (trcu) that holds the count of the timer c upper digit (figures 47 and 48). the operation of timer read register c is basically the same as that of timer read register b (trbl: $00a, trbu: $00b). bit initial value read/write bit name 3 undefined r trcl3 2 undefined r trcl2 0 undefined r trcl0 1 undefined r trcl1 timer read register c (lower digit) (trcl: $00e) figure 47 timer read register c lower digit (trcl) bit initial value read/write bit name 3 undefined r trcu3 2 undefined r trcu2 0 undefined r trcu0 1 undefined r trcu1 timer read register c (upper digit) (trcu: $00f) figure 48 timer read register c upper digit (trcu)
hd404358 series 59 alarm output function the mcu has a built-in pulse output function called buzz. the pulse frequency can be selected from the prescaler s? outputs, and the output frequency depends on the state of port mode register c (pmrc: $025). the duty cycle of the pulse output is fixed at 50%. internal data bus ? ? ? ? 256 512 1024 2048 selector system clock per prescaler s (pss) 2 alarm output control signal buzz alarm output controller port mode register c (pmrc) port mode register a (pmra) figure 49 alarm output function block diagram port mode register c (pmrc: $025): four-bit write-only register that selects the alarm frequencies as shown in figure 50. it is reset to $0 by mcu reset. bit initial value read/write bit name 3 0 w pmrc3 2 0 w pmrc2 0 0 w pmrc0 1 undefined w pmrc1 port mode register c (pmrc: $025) pmrc1 0 1 output level control in idle states low level high level pmrc0 0 1 serial clock division ratio prescaler output divided by 2 prescaler output divided by 4 pmrc3 0 1 0 1 pmrc2 system clock divisor ? 2048 ? 1024 ? 512 ? 256 0 1 figure 50 port mode register c (pmrc)
hd404358 series 60 port mode register a (pmra: $004): four-bit write-only register that selects d 3 /buzz pin function as shown in figure 44. it is reset to $0 by mcu reset. serial interface the serial interface serially transfers and receives 8-bit data, and includes the following features. multiple transmit clock sources ? external clock ? internal prescaler output clock ? system clock output level control in idle states five registers, an octal counter, and a selector are also configured for the serial interface as follows. serial data register (srl: $006, sru: $007) serial mode register (smr: $005) port mode register a (pmra: $004) port mode register c (pmrc: $025) miscellaneous register (mis: $00c) octal counter (oc) selector the block diagram of the serial interface is shown in figure 51.
hd404358 series 61 internal data bus ? ? ? ? ? ? 2 8 32 128 512 2048 port mode register c (pmrc) sck selector system clock per prescaler s (pss) idle controller 3 serial mode register (smr) clock serial data register (sr) serial interrupt request flag (ifs) selector 1/2 1/2 si so octal counter (oc) i/o controller transfer control signal figure 51 serial interface block diagram serial interface operation selecting and changing the operating mode: table 27 lists the serial interface? operating modes. to select an operating mode, use one of these combinations of port mode register a (pmra: $004) and the serial mode register (smr: $005) settings; to change the operating mode, always initialize the serial interface internally by writing data to the serial mode register. note that the serial interface is initialized by writing data to the serial mode register. refer to the following serial mode register section for details. table 27 serial interface operating modes smr pmra bit 3 bit 1 bit 0 operating mode 1 0 0 continuous clock output mode 1 transmit mode 1 0 receive mode 1 transmit/receive mode
hd404358 series 62 pin setting: the r0 0 / sck pin is controlled by writing data to the serial mode register (smr: $005). the r0 1 /si and r0 2 /so pins are controlled by writing data to port mode register a (pmra: $004). refer to the following registers for serial interface section for details. transmit clock source setting: the transmit clock source is set by writing data to the serial mode register (smr: $005) and port mode register c (pmrc: $025). refer to the following registers for serial interface section for details. data setting: transmit data is set by writing data to the serial data register (srl: $006, sru, $007). receive data is obtained by reading the contents of the serial data register. the serial data is shifted by the transmit clock and is input from or output to an external system. the output level of the so pin is invalid until the first data is output after mcu reset, or until the output level control in idle states is performed. transfer control: the serial interface is activated by the sts instruction. the octal counter is reset to 000 by this instruction, and it increments at the rising edge of the transmit clock. when the eighth transmit clock signal is input or when serial transmission/receive is discontinued, the octal counter is reset to 000, the serial interrupt request flag (ifs: $003, bit 2) is set, and the transfer stops. when the prescaler output is selected as the transmit clock, the transmit clock frequency is selected as 4t cyc to 8192t cyc by setting bits 0 to 2 (smr0?smr2) of serial mode register (smr: $005) and bit 0 (pmrc0) of port mode register c (pmrc: $025) as listed in table 28. table 28 serial transmit clock (prescaler output) pmrc smr bit 0 bit 2 bit 1 bit 0 prescaler division ratio transmit clock frequency 00 00 ? 2048 4096t cyc 1 ? 512 1024t cyc 10 ? 128 256t cyc 1 ? 32 64t cyc 100 ? 8 16t cyc 1 ? 24t cyc 10 00 ? 4096 8192t cyc 1 ? 1024 2048t cyc 10 ? 256 512t cyc 1 ? 64 128t cyc 100 ? 16 32t cyc 1 ? 48t cyc
hd404358 series 63 operating states: the serial interface has the following operating states; transitions between them are shown in figure 52. sts wait state transmit clock wait state transfer state continuous clock output state (only in internal clock mode) sts wait state: the serial interface enters sts wait state by mcu reset (00, 10 in figure 59). in sts wait state, the serial interface is initialized and the transmit clock is ignored. if the sts instruction is then executed (01, 11), the serial interface enters transmit clock wait state. transmit clock wait state: transmit clock wait state is between the sts execution and the falling edge of the first transmit clock. in transmit clock wait state, input of the transmit clock (02, 12) increments the octal counter, shifts the serial data register, and enters the serial interface in transfer state. however, note that if continuous clock output mode is selected in internal clock mode, the serial interface does not enter transfer state but enters continuous clock output state (17). the serial interface enters sts wait state by writing data to the serial mode register (smr: $005) (04, 14) in transmit clock wait state. transfer state: transfer state is between the falling edge of the first clock and the rising edge of the eighth clock. in transfer state, the input of eight clocks or the execution of the sts instruction sets the octal counter to 000, and the serial interface enters another state. when the sts instruction is executed (05, 15), transmit clock wait state is entered. when eight clocks are input, transmit clock wait state is entered (03) in external clock mode, and sts wait state is entered (13) in internal clock mode. in internal clock mode, the transmit clock stops after outputting eight clocks. in transfer state, writing data to the serial mode register (smr: $005) (06, 16) initializes the serial interface, and sts wait state is entered. if the state changes from transfer to another state, the serial interrupt request flag (ifs: $003, bit 2) is set by the octal counter that is reset to 000. continuous clock output state (only in internal clock mode): continuous clock output state is entered only in internal clock mode. in this state, the serial interface does not transmit/receive data but only outputs the transmit clock from the sck pin. when bits 0 and 1 (pmra0, pmra1) of port mode register a (pmra: $004) are 00 in transmit clock wait state and if the transmit clock is input (17), the serial interface enters continuous clock output state. if the serial mode register (smr: $005) is written to in continuous clock output mode (18), sts wait state is entered.
hd404358 series 64 sts wait state (octal counter = 000, transmit clock disabled) transmit clock wait state (octal counter = 000) transfer state (octal counter = 000) mcu reset 00 smr write 04 sts instruction 01 transmit clock 02 8 transmit clocks 03 sts instruction (ifs 1) 05 ? smr write (ifs 1) 06 ? external clock mode sts wait state (octal counter = 000, transmit clock disabled) transmit clock wait state (octal counter = 000) transfer state (octal counter = 000) smr write 14 sts instruction 11 transmit clock 12 15 sts instruction (ifs 1) ? 8 transmit clocks 13 internal clock mode continuous clock output state (pmra 0, 1 = 0, 0) smr write 18 transmit clock 17 16 note: refer to the operating states section for the corresponding encircled numbers. mcu reset 10 ? smr write (ifs 1) figure 52 serial interface state transitions output level control in idle states: in idle states, that is, sts wait state and transmit clock wait state, the output level of the so pin can be controlled by setting bit 1 (pmrc1) of port mode register c (pmrc: $025) to 0 or 1. the output level control example is shown in figure 53. note that the output level cannot be controlled in transfer state.
hd404358 series 65  
   state mcu reset pmra write smr write pmrc write srl, sru write sts instruction sck pin (input) so pin ifs sts wait state transmit clock wait state transfer state transmit clock wait state sts wait state port selection external clock selection output level control in idle states dummy write for state transition output level control in idle states data write for transmission undefined lsb msb flag reset at transfer completion external clock mode     state mcu reset pmra write smr write pmrc write srl, sru write sts instruction sck pin (output) so pin ifs sts wait state transfer state transmit clock wait state sts wait state port selection internal clock selection output level control in idle states data write for transmission output level control in idle states undefined lsb msb flag reset at transfer completion internal clock mode figure 53 example of serial interface operation sequence
hd404358 series 66 transmit clock error detection (in external clock mode): the serial interface will malfunction if a spurious pulse caused by external noise conflicts with a normal transmit clock during transfer. a transmit clock error of this type can be detected as shown in figure 54. transfer completion (ifs 1) interrupts inhibited ifs 0 smr write ifs = 1 transmit clock error processing normal termination ? ? yes no transmit clock error detection flowchart   transmit clock error detection procedure state sck pin (input) transmit clock wait state transfer state transfer state transmit clock wait state noise transfer state has been entered by the transmit clock error. when smr is written, ifs is set. flag set because octal counter reaches 000 flag reset at transfer completion smr write ifs 12 3 45678 figure 54 transmit clock error detection
hd404358 series 67 if more than eight transmit clocks are input in transfer state, at the eighth clock including a spurious pulse by noise, the octal counter reaches 000, the serial interrupt request flag (ifs: $003, bit 2) is set, and transmit clock wait state is entered. at the falling edge of the next normal clock signal, the transfer state is entered. after the transfer completion processing is performed and ifs is reset, writing to the serial mode register (smr: $005) changes the state from transfer to sts wait. at this time ifs is set again, and therefore the error can be detected. notes on use: initialization after writing to registers: if port mode register a (pmra: $004) is written to in transmit clock wait state or in transfer state, the serial interface must be initialized by writing to the serial mode register (smr: $005) again. serial interrupt request flag (ifs: $003, bit 2) set: if the state is changed from transfer to another by writing to the serial mode register (smr: $005) or executing the sts instruction during the first low pulse of the transmit clock, the serial interrupt request flag is not set. to set the serial interrupt request flag, serial mode register write or sts instruction execution must be programmed to be executed after confirming that the sck pin is at 1, that is, after executing the input instruction to port r0. registers for serial interface the serial interface operation is selected, and serial data is read and written by the following registers. serial mode register (smr: $005) serial data register (srl: $006, sru: $007) port mode register a (pmra: $004) port mode register c (pmrc: $025) miscellaneous register (mis: $00c) serial mode register (smr: $005): this register has the following functions (figure 55). r0 0 / sck pin function selection transmit clock selection prescaler division ratio selection serial interface initialization serial mode register (smr: $005) is a 4-bit write-only register. it is reset to $0 by mcu reset. a write signal input to serial mode register (smr: $005) discontinues the input of the transmit clock to the serial data register and octal counter, and the octal counter is reset to 000. therefore, if a write is performed during data transfer, the serial interrupt request flag (ifs: $003, bit 2) is set. written data is valid from the second instruction execution cycle after the write operation, so the sts instruction must be executed at least two cycles after that.
hd404358 series 68 bit initial value read/write bit name 3 0 w smr3 2 0 w smr2 0 0 w smr0 1 0 w smr1 serial mode register (smr: $005) 0 1 0 1 0 1 0 1 0 1 0 1 0 1 smr2 smr0 smr1 smr3 0 1 r0 0 / sck mode selection r0 0 sck sck output output input clock source external clock prescaler division ratio refer to table 28 prescaler system clock figure 55 serial mode register (smr) port mode register c (pmrc: $025): this register has the following functions (figure 56). prescaler division ratio selection output level control in idle states port mode register c (pmrc: $025) is a 4-bit write-only register. it cannot be written during data transfer. by setting bit 0 (pmrc0) of this register, the prescaler division ratio is selected. bit 0 (pmrc0) can be reset to 0 by mcu reset. by setting bit 1 (pmrc1), the output level of the so pin is controlled in idle states. the output level changes at the same time that pmrc1 is written to.
hd404358 series 69 bit initial value read/write bit name 3 0 w pmrc3 2 0 w pmrc2 0 0 w pmrc0 1 undefined w pmrc1 port mode register c (pmrc: $025) pmrc1 0 1 output level control in idle states low level high level pmrc0 0 1 serial clock division ratio prescaler output divided by 2 prescaler output divided by 4 alarm output function. refer to figure 50. figure 56 port mode register c (pmrc) serial data register (srl: $006, sru: $007): this register has the following functions (figures 57 and 58). transmission data write and shift receive data shift and read writing data in this register is output from the so pin, lsb first, synchronously with the falling edge of the transmit clock; data is input, lsb first, through the si pin at the rising edge of the transmit clock. input/output timing is shown in figure 59. data cannot be read or written during serial data transfer. if a read/write occurs during transfer, the accuracy of the resultant data cannot be guaranteed. bit initial value read/write bit name 3 undefined r/w sr3 2 undefined r/w sr2 0 undefined r/w sr0 1 undefined r/w sr1 serial data register (lower digit) (srl: $006) figure 57 serial data register (srl)
hd404358 series 70 bit initial value read/write bit name 3 undefined r/w sr7 2 undefined r/w sr6 0 undefined r/w sr4 1 undefined r/w sr5 serial data register (upper digit) (sru: $007) figure 58 serial data register (sru) lsb msb 12 345 678 transmit clock serial output data serial input data latch timing figure 59 serial interface output timing port mode register a (pmra: $004): this register has the following functions (figure 60). r0 1 /si pin function selection r0 2 /so pin function selection port mode register a (pmra: $004) is a 4-bit write-only register, and is reset to $0 by mcu reset.
hd404358 series 71 bit initial value read/write bit name 3 0 w pmra3 2 0 w pmra2 0 0 w pmra0 1 0 w pmra1 pmra0 0 1 r0 2 /so mode selection r0 2 so port mode register a (pmra: $004) pmra1 0 1 r0 1 /si mode selection r0 1 si pmra2 0 1 r0 3 /toc mode selection r0 3 toc pmra3 0 1 d 3 /buzz mode selection d 3 buzz figure 60 port mode register a (pmra) miscellaneous register (mis: $00c): this register has the following functions (figure 61). r0 2 /so pin pmos control miscellaneous register (mis: $00c) is a 4-bit write-only register and is reset to $0 by mcu reset. bit initial value read/write bit name 3 0 w mis3 2 0 w mis2 0 not used 1 not used mis2 cmos buffer on/off selection for pin r0 2 /so miscellaneous register (mis: $00c) 0 1 pmos active pmos off mis3 0 1 pull-up mos on/off selection pull-up mos off pull-up mos on (refer to table 21) figure 61 miscellaneous register (mis)
hd404358 series 72 a/d converter the mcu has a built-in a/d converter that uses a sequential comparison method with a resistor ladder. it can measure eight analog inputs with 8-bit resolution. the block diagram of the a/d converter is shown in figure 62. i ad off flag (iaof) selector 3 a/d channel register (acr) a/d mode register 1 (amr1) a/d interrupt request flag (ifad) encoder a/d data register (adru, l) a/d start flag (adsf) d/a av cc av ss operating mode signal (1 in stop mode) internal data bus + comp a/d controller an 0 an 1 an 2 an 3 an 4 an 5 an 6 an 7 control signal for conversion time 4 a/d mode register 2 (amr2) figure 62 a/d converter block diagram
hd404358 series 73 registers for a/d converter operation a/d mode register 1 (amr1: $019): four-bit write-only register which selects digital or analog ports, as shown in figure 63. bit initial value read/write bit name 3 0 w amr13 2 0 w amr12 0 0 w amr10 1 0 w amr11 amr10 0 1 an 0 a/d mode register 1 (amr1: $019) amr11 0 1 an 1 amr12 0 1 r3 2 /an 2 mode selection r3 2 an 2 amr13 0 1 r3 3 /an 3 mode selection r3 3 an 3 r3 0 /an 0 mode selection r3 0 r3 1 /an 1 mode selection r3 1 figure 63 a/d mode register 1 (amr1) a/d mode register 2 (amr2: $01a): two-bit write-only register which is used to set the a/d conversion period and to select digital or analog ports. bit 0 of the a/d mode register selects the a/d conversion period, and bit 1 selects port r4 as pins an 4 ?n 7 in 4-pin units (figure 64). bit initial value read/write bit name 3 not used 2 not used 0 0 w amr20 1 0 w amr21 amr20 0 1 67 t cyc a/d mode register 2 (amr2: $01a) amr21 0 1 an 4 ?n 7 conversion time 34 t cyc r4/an 4 ?n 7 pin selection r4 figure 64 a/d mode register 2 (amr2)
hd404358 series 74 a/d channel register (acr: $016): three-bit write-only register which indicates analog input pin information, as shown in figure 65. bit initial value read/write bit name 3 not used 2 0 w acr2 0 0 w acr0 1 0 w acr1 a/d channel register (acr: $016) 0 0 1 0 1 0 1 0 1 0 1 analog input selection an 0 an 1 an 2 an 3 an 4 an 5 an 6 acr1 acr2 acr0 0 1 1 an 7 figure 65 a/d channel register (acr) a/d start flag (adsf: $02c, bit 2): one-bit flag that initiates a/d conversion when set to 1. at the completion of a/d conversion, the converted data is stored in the a/d data register and the a/d start flag is cleared. refer to figure 66. bit initial value read/write bit name 3 not used 2 0 r/w adsf 1 0 w wdon a/d start flag (adsf: $020, bit 2) refer to the description of timers wdon 0 1 a/d conversion completed a/d conversion started a/d start flag (adsf) 0 not used figure 66 a/d start flag (adsf)
hd404358 series 75 i ad off flag (iaof: $021, bit 2): by setting the i ad off flag to 1, the current flowing through the resistance ladder can be cut off even while operating in standby or active mode, as shown in figure 67. bit initial value read/write bit name 3 0 r/w rame 2 0 r/w iaof 0 0 r/w icsf 1 0 r/w icef i ad off flag (iaof: $021, bit 2) refer to the description of operating modes rame refer to the description of timers icef refer to the description of timers icsf 0 1 i ad current flows i ad current is cut off i ad off flag (iaof) figure 67 i ad off flag (iaof) a/d data register (adrl: $017, adru: $018): eight-bit read-only register consisting of a 4-bit lower digit and 4-bit upper digit. this register is not cleared by reset. after the completion of a/d conversion, the resultant eight-bit data is held in this register until the start of the next conversion (figures 68, 69, and 70). 3210 msb lsb 3210 bit 0 bit 7 adru: $018 adrl: $017 figure 68 a/d data registers (adru, adrl)
hd404358 series 76 bit initial value read/write bit name 3 0 r adrl3 2 0 r adrl2 0 0 r adrl0 1 0 r adrl1 a/d data register (lower digit) (adrl: $017) figure 69 a/d data register lower digit (adrl) bit initial value read/write bit name a/d data register (upper digit) (adru: $018) 2 0 r adru2 1 0 r adru1 0 0 r adru0 3 1 r adru3 figure 70 a/d data register upper digit (adru) notes on usage use the sem or semd instruction for writing to the a/d start flag (adsf) do not write to the a/d start flag during a/d conversion data in the a/d data register during a/d conversion is undefined since the operation of the a/d converter is based on the clock from the system oscillator, the a/d converter does not operate in stop mode. in addition, to save power while in these modes, all current flowing through the converter? resistance ladder is cut off. if the power supply for the a/d converter is to be different from v cc , connect a 0.1- m f bypass capacitor between the av cc and av ss pins. (however, this is not necessary when the av cc pin is directly connected to the v cc pin.) the contents of the a/d data register are not guaranteed during a/d conversion. to ensure that the a/d converter oparates stably, do not execute port output instructions during a/d convention. the port data register (pdr) is initialized to 1 by an mcu reset. at this time, if pull-up mos is selected as active by bit 3 of the miscellaneous register (mis3), the port will be pulled up to v cc . when using a shared r port/analog input pin as an input pin, clear pdr to 0. otherwise, if pull-up mos is selected by mis3 and pdr is set to 1, a pin selected by a/d mode register 1 or 2 (amr1 or amr2) as an analog pin will remain pulled up (figure 71).
hd404358 series 77 v cc v cc hlt mis3 dcr pdr cpu input input control signal acr a/d input a/d channel register value amr a/d mode register value figure 71 r port/analog multiplexed pin circuit
hd404358 series 78 pin description in prom mode the hd4074359 is a prom version of a ztat ? microcomputer. in prom mode, the mcu stops operating, thus allowing the user to program the on-chip prom. pin number mcu mode prom mode dp-42s fp-44a pin i/o pin i/o 139ra 1 io 0 i/o 240r0 0 / sck i/o v cc 341r0 1 /si i/o v cc 442r0 2 /so i/o o 1 i/o 543r0 3 /toc i/o o 2 i/o 6 1 test i v pp 72 reset i reset i 8 3 osc 1 iv cc 9 4 osc 2 o 10 5 gnd gnd 11 6 av ss gnd 12 7 r3 0 /an 0 i/o o 0 i/o 13 8 r3 1 /an 1 i/o o 1 i/o 14 9 r3 2 /an 2 i/o o 2 i/o 15 10 r3 3 /an 3 i/o o 3 i/o 16 11 r4 0 /an 4 i/o o 4 i/o 17 12 r4 1 /an 5 i/o m 0 i 18 13 r4 2 /an 6 i/o m 1 i 19 14 r4 3 /an 7 i/o 20 15 av cc v cc 21 16 v cc v cc 22 17 d 0 / int 0 i/o o 3 i/o 23 18 d 1 / int 1 i/o o 4 i/o 24 19 d 2 /evnb i/o a 1 i 25 20 d 3 /buzz i/o a 2 i 26 21 d 4 / stopc i/o 27 23 d 5 i/o a 3 i 28 24 d 6 i/o a 4 i 29 25 d 7 i/o a 9 i 30 26 d 8 i/o v cc
hd404358 series 79 pin number mcu mode prom mode dp-42s fp-44a pin i/o pin i/o 31 27 r8 0 i/o ce i 32 28 r8 1 i/o oe i 33 29 r8 2 i/o a 13 i 34 30 r8 3 i/o a 14 i 35 31 r1 0 i/o a 5 i 36 32 r1 1 i/o a 6 i 37 33 r1 2 i/o a 7 i 38 34 r1 3 i/o a 8 i 39 35 r2 0 i/o a 0 i 40 36 r2 1 i/o a 10 i 41 37 r2 2 i/o a 11 i 42 38 r2 3 i/o a 12 i notes: 1. i/o: input/output pin; i: input pin; o: output pin 2. o 0 to o 4 consist of two pins each. the each pair together before using them.
hd404358 series 80 programming the built-in prom the mcu? built-in prom is programmed in prom mode. prom mode is set by pulling reset , m 0 , and m 1 low, as shown in figure 72. in prom mode, the mcu does not operate, but it can be programmed in the same way as any other commercial 27256-type eprom using a standard prom programmer and a 100-to-28-pin socket adapter. recommended prom programmers and socket adapters are listed in table 29. since an hmcs400-series instruction is ten bits long, the hmcs400-series mcu has a built-in conversion circuit to enable the use of a general-purpose prom programmer. this circuit splits each instruction into five lower bits and five upper bits that are read from or written to consecutive addresses. this means that if, for example, 16 kwords of built-in prom are to be programmed by a general-purpose prom programmer, a 32-kbyte address space ($0000?7fff) must be specified. table 29 recommended prom programmers and socket adapters prom programmer socket adapter manufacture model name package manufacture model name data i/o corp 121 b dp-42s hitachi hs4359ess01h fp-44a hs4359esh01h aval corp pkw-1000 dp-42s hitachi hs4359ess01h fp-44a hs4359esh01h control signals address bus data bus v cc gnd v pp o 7 ? 0 o 7 o 6 o 5 o 4 ? 0 ce , oe a 14 ? 0 o 4 ? 0 m 0 m 1 reset v cc gnd v pp hd407a4359 prom mode pins socket adapter prom programmer figure 72 prom mode connections
hd404358 series 81 warnings 1. always specify addresses $0000 to $7fff when programming with a prom programmer. if address $8000 or higher is accessed, the prom may not be programmed or verified correctly. set all data in unused addresses to $ff. note that the plastic-package version cannot be erased and reprogrammed. 2. make sure that the prom programmer, socket adapter, and lsi are aligned correctly (their pin 1 positions match), otherwise overcurrents may damage the lsi. before starting programming, make sure that the lsi is firmly fixed in the socket adapter and the socket adapter is firmly fixed onto the programmer. 3. prom programmers have two voltages (v pp ): 12.5 v and 21 v. remember that ztat ? devices require a v pp of 12.5 v?he 21-v setting will damage them. 12.5 v is the intel 27256 setting. programming and verification the built-in prom of the mcu can be programmed at high speed without risk of voltage stress or damage to data reliability. programming and verification modes are selected as listed in table 30. for details of prom programming, refer to the following notes on prom programming section. table 30 prom mode selection pin mode ce oe v pp o 0 ? 4 programming low high v pp data input verification high low v pp data output programming inhibited high high v pp high impedance
hd404358 series 82 addressing modes ram addressing modes the mcu has three ram addressing modes, as shown in figure 73 and described below. register indirect addressing mode: the contents of the w, x, and y registers (10 bits in total) are used as a ram address. direct addressing mode: a direct addressing instruction consists of two words. the first word contains the opcode, and the contents of the second word (10 bits) are used as a ram address. memory register addressing mode: the memory registers (mr), which are located in 16 addresses from $040 to $04f, are accessed with the lamr and xmra instructions. ap 9 ap 0 w 1 y 0 w register x register y register ram address register direct addressing ap 9 ap 0 ram address direct addressing d 9 d 0 2nd word of instruction opcode 1st word of instruction ap 9 ap 0 ram address memory register addressing m 3 opcode instruction 000100 ap 8 ap 7 ap ap 5 ap 4 6 ap 3 ap 2 ap 1 ap ap ap ap ap ap ap ap 87654321 d 8 d 7 d 6 d 5 d 4 d 3 d 2 d 1 ap 8 ap 7 ap 6 ap 5 ap 4 ap 3 ap 2 ap 1 w 0 x 3 x 2 x 1 x 0 y 3 y 2 y 1 m 2 m 1 m 0 figure 73 ram addressing modes
hd404358 series 83 rom addressing modes and the p instruction the mcu has four rom addressing modes, as shown in figure 74 and described below. direct addressing mode: a program can branch to any address in the rom memory space by executing the jmpl, brl, or call instruction. each of these instructions replaces the 14 program counter bits (pc 13 ?c 0 ) with 14-bit immediate data. current page addressing mode: the mcu has 64 pages of rom with 256 words per page. a program can branch to any address in the current page by executing the br instruction. this instruction replaces the eight low-order bits of the program counter (pc 7 ?c 0 ) with eight-bit immediate data. if the br instruction is on a page boundary (address 256n + 255), executing that instruction transfers the pc contents to the next physical page, as shown in figure 76. this means that the execution of the br instruction on a page boundary will make the program branch to the next page. note that the hmcs400-series cross macroassembler has an automatic paging feature for rom pages. zero-page addressing mode: a program can branch to the zero-page subroutine area located at $0000 $003f by executing the cal instruction. when the cal instruction is executed, 6 bits of immediate data are placed in the six low-order bits of the program counter (pc 5 ?c 0 ), and 0s are placed in the eight high- order bits (pc 13 ?c 6 ). table data addressing mode: a program can branch to an address determined by the contents of four-bit immediate data, the accumulator, and the b register by executing the tbr instruction. p instruction: rom data addressed in table data addressing mode can be referenced with the p instruction as shown in figure 75. if bit 8 of the rom data is 1, eight bits of rom data are written to the accumulator and the b register. if bit 9 is 1, eight bits of rom data are written to the r1 and r2 port output registers. if both bits 8 and 9 are 1, rom data is written to the accumulator and the b register, and also to the r1 and r2 port output registers at the same time. the p instruction has no effect on the program counter
hd404358 series 84 d 9 d 8 d 7 d 6 d 5 d 4 d 3 d 2 d 1 d 0 2nd word of instruction opcode 1st word of instruction [jmpl] [brl] [call] pc 9 pc 8 pc 7 pc 6 pc 5 pc 4 pc 3 pc 2 pc 1 pc 0 pc pc pc pc 10 11 12 13 program counter direct addressing zero page addressing a 5 a 4 a 3 a 2 a 1 a 0 instruction [cal] opcode pc 98 pc 76 pc 54 pc 3 pc 1 pc 0 pc pc 10 11 12 13 program counter 00 00 0 0 0 0 pc pc pc pc pc pc 2 b 1 b 0 a 3 a 2 a 1 a 0 accumulator program counter table data addressing pc 9 pc 8 pc 7 pc 6 pc 5 pc 4 pc 3 pc 2 pc 1 pc 0 pc pc pc 10 11 12 13 b 2 b 3 b register p 3 p 0 [tbr] instruction opcode 0 0 p 2 p 1 pc opcode b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 instruction pc 90 pc pc pc 11 12 13 program counter current page addressing [br] pc 10 7 pc 6 pc 5 pc 4 pc 3 pc 2 pc 1 pc pc 8 pc p 0 p 1 p 2 p 3 figure 74 rom addressing modes
hd404358 series 85 b 1 b 0 a 3 a 2 a 1 a 0 accumulator referenced rom address address designation ra 9 ra 8 ra 7 ra 6 ra 5 ra 4 ra 3 ra 2 ra 1 ra 0 ra ra ra 10 11 12 13 b 2 b 3 b register 0 0 p 3 p 0 [p] instruction opcode p 2 p 1 ra ro 9 ro 0 ro 8 ro 7 ro 6 ro 5 ro 4 ro 3 ro 2 ro 1 bbbb aa a a 3210 3210 if ro = 1 8 accumulator, b register rom data pattern output ro 9 rom data r2 3 r2 2 r2 1 r2 0 r1 3 r1 2 r1 1 r1 0 if ro = 1 9 output registers r1, r2 ro 0 ro 8 ro 7 ro 6 ro 5 ro 4 ro 3 ro 2 ro 1 figure 75 p instruction
hd404358 series 86 br aaa aaa nop 256 (n ?1) + 255 256n br aaa br bbb 256n + 254 256n + 255 256 (n + 1) bbb nop figure 76 branching when the branch destination is on a page boundary
hd404358 series 87 absolute maximum ratings item symbol value unit notes supply voltage v cc ?.3 to +7.0 v programming voltage v pp ?.3 to +14.0 v 1 pin voltage v t ?.3 to v cc + 0.3 v 2 ?.3 to +15.0 v 3 total permissible input current ? i o 105 ma 4 total permissible output current ? i o 50 ma 5 maximum input current i o 4 ma 6, 7 30 ma 6, 8 maximum output current ? o 4 ma 7, 9 operating temperature t opr ?0 to +75 c storage temperature t stg ?5 to +125 c notes: permanent damage may occur if these absolute maximum ratings are exceeded. normal operation must be under the conditions stated in the electrical characteristics tables. if these conditions are exceeded, the lsi may malfunction or its reliability may be affected. 1. applies to pin test (v pp ) of hd407a4359. 2. applies to all standard voltage pins. 3. applies to intermediate-voltage pins. 4. the total permissible input current is the total of input currents simultaneously flowing in from all the i/o pins to gnd. 5. the total permissible output current is the total of output currents simultaneously flowing out from v cc to all i/o pins. 6. the maximum input current is the maximum current flowing from each i/o pin to gnd. 7. applies to ports d 0 to d 8 , r0, r1, r3, r4, and r8. 8. applies to port r2. 9. the maximum output current is the maximum current flowing from v cc to each i/o pin.
hd404358 series 88 electrical characteristics dc characteristics (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c; hd404354/ hd404356/hd404358/hd40a4354/hd40a4356/hd40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c, unless otherwise specified) item symbol pins min typ max unit test condition notes input high voltage v ih reset , sck , int 0 , int 1 , stopc , evnb 0.8v cc ? cc + 0.3 v si 0.7 v cc ? cc + 0.3 v osc 1 v cc ?0.5 v cc + 0.3 v input low voltage v il reset , sck , int 0 , int 1 , stopc , evnb ?.3 0.2v cc v si ?.3 0.3v cc v osc 1 ?.3 0.5 v output high voltage v oh sck , so, toc v cc ?0.5 v i oh = 0.5 ma output low voltage v ol sck , so, toc 0.4 v i ol = 0.4 ma i/o leakage current |i il | reset , sck , si, so,toc,osc 1 , int 0 , int 1 , stopc , evnb 1 m av in = 0 v to v cc 1 current dissipation in active mode i cc v cc 5.0 ma v cc = 5 v, f osc = 4 mhz 2 current dissipation in standby mode i sby v cc 2.0 ma v cc = 5 v, f osc = 4 mhz 3 current dissipation in stop mode i stop v cc 10 m av cc = 5 v 4 stop mode retaining voltage v stop v cc 2v notes: 1. excludes current flowing through pull-up mos and output buffers. 2. i cc is the source current when no i/o current is flowing while the mcu is in reset state. test conditions: mcu: reset pins: reset , test at gnd
hd404358 series 89 3. i sby is the source current when no i/o current is flowing while the mcu timer is operating. test conditions: mcu: i/o reset standby mode pins: reset at v cc test at gnd d 0 ? 8 , r0?4, r8, ra 1 at v cc 4. this is the source current when no i/o current is flowing. test conditions: pins: reset at v cc test at gnd d 0 ? 8 , r0?4, r8, ra 1 at v cc i/o characteristics for standard pins (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c; hd404354/hd404356/hd404358 /hd40a4354/hd40a4356/hd40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c, unless otherwise specified) item symbol pins min typ max unit test condition note input high voltage v ih d 0 ? 8 , r0, r1, r3, r4, r8, ra 1 0.7v cc ? cc + 0.3 v input low voltage v il d 0 ? 8 , r0, r1, r3, r4, r8, ra 1 ?.3 0.3v cc v output high voltage v oh d 0 ? 8 , r0, r1, r3, r4, r8 v cc ?0.5 v i oh = 0.5 ma output low voltage v ol d 0 ? 8 , r0, r1, r3, r4, r8 0.4 v i ol = 1.6 ma input leakage current |i il |d 0 ? 8 , r0, r1, r3, r4, r8, ra 1 1 m av in = 0 v to v cc 1 pull-up mos current ? pu d 0 ? 8 , r0, r1, r3, r4, r8 30 150 300 m av cc = 5 v, v in = 0 v note: 1. output buffer current is excluded.
hd404358 series 90 i/o characteristics for intermediate-voltage pins (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c;hd404354/hd404356/hd404358 /hd40a4354/hd40a4356/hd 40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c, unless otherwise specified) item symbol pins min typ max unit test condition note input high voltage v ih r2 0.7v cc ?2v input low voltage v il r2 ?.3 0.3v cc v output high voltage v oh r2 11.5 v 500 k w at 12 v output low voltage v ol r2 0.4 v i ol = 0.4 ma 2.0 v i ol = 15 ma, v cc = 4.5 to 5.5 v i/o leakage current |i il | r2 20 m av in = 0 v to 12 v 1 note: 1. excludes output buffer current.
hd404358 series 91 a/d converter characteristics (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c; hd404354/hd404356/hd404358 /hd40a4354/hd40a4356/hd40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c, unless otherwise specified) item symbol pins min typ max unit test condition note analog supply voltage av cc av cc v cc ?0.3 v cc v cc + 0.3 v 1 analog input voltage av in an 0 ?n 7 av ss ?v cc v current flowing between av cc and av ss i ad 200 m av cc = av cc = 5.0 v analog input capacitance ca in an 0 ?n 7 30pf resolution 8 8 8 bit number of input channels 0 8 channel absolute accuracy 2.0 lsb conversion time 34 67 t cyc input impedance an 0 ?n 7 1m w note: 1. connect this to v cc if the a/d converter is not used.
hd404358 series 92 standard f osc = 5.0 mhz version ac characteristics (hd404354/hd404356/hd404358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c) item symbol pins min typ max unit test condition note clock oscillation frequency f osc osc 1 , osc 2 0.4 4 5.0 mhz 1/4 system clock division ratio instruction cycle time t cyc 0.8 1 10 m s oscillation stabilization time (ceramic oscillator) t rc osc 1 , osc 2 7.5 ms 1 oscillation stabilization time (crystal oscillator) t rc osc 1 , osc 2 40 ms 1 external clock high width t cph osc 1 80ns 2 external clock low width t cpl osc 1 80ns 2 external clock rise time t cpr osc 1 20 ns 2 external clock fall time t cpf osc 1 20 ns 2 int 0 , int 1 , evnb high widths t ih int 0 , int 1 , evnb 2 t cyc 3 int 0 , int 1 , evnb low widths t il int 0 , int 1 , evnb 2 t cyc 3 reset low width t rstl reset 2 t cyc 4 stopc low width t stpl stopc 1 t rc 5 reset rise time t rstr reset 20 ms 4 stopc rise time t stpr stopc 20 ms 5 input capacitance c in all input pins except and r2 15 pf f = 1 mhz, v in = 0 v r2 30 pf f = 1 mhz, v in = 0 v notes: 1. the oscillation stabilization time is the period required for the oscillator to stabilize in the following situations: a. after v cc reaches 2.7 v at power-on. b. after reset input goes low when stop mode is cancelled. c. after stopc input goes low when stop mode is cancelled. to ensure the oscillation stabilization time at power-on or when stop mode is cancelled, reset or stopc must be input for at least a duration of t rc . when using a crystal or ceramic oscillator, consult with the manufacturer to determine what stabilization time is required, since it will depend on the circuit constants and stray capacitance. 2. refer to figure 77. 3. refer to figure 78. 4. refer to figure 79. 5. refer to figure 80.
hd404358 series 93 high-speed f osc = 8.5 mhz version ac characteristics (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c; hd40a4354/hd40a4356/hd40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c) item symbol pins min typ max unit test condition note clock oscillation frequency f osc osc 1 , osc 2 0.4 4 5.0 mhz 1/4 system clock division ratio 0.4 4 8.5 mhz 1/4 system clock division ratio, v cc = 4.5 to 5.5 v instruction cycle time t cyc 0.8 1 10 m s 0.47 1 10 m sv cc = 4.5 to 5.5 v oscillation stabilization time (ceramic oscillator) t rc osc 1 , osc 2 7.5 ms 1 oscillation stabilization time (crystal oscillator) t rc osc 1 , osc 2 40 ms 1 external clock high width t cph osc 1 80 ns 2 47 ns v cc = 4.5 to 5.5 v 2 external clock low width t cpl osc 1 80 ns 2 47 ns v cc = 4.5 to 5.5 v 2 external clock rise time t cpr osc 1 20 ns 2 15 ns v cc = 4.5 to 5.5 v 2 external clock fall time t cpf osc 1 20 ns 2 15 ns v cc = 4.5 to 5.5 v 2 int 0 , int 1 , evnb high widths t ih int 0 , int 1 , evnb 2 t cyc 3 int 0 , int 1 , evnb low widths t il int 0 , int 1 , evnb 2 t cyc 3 reset low width t rstl reset 2t cyc 4 stopc low width t stpl stopc 1t rc 5 reset rise time t rstr reset 20 ms 4 stopc rise time t stpr stopc 20 ms 5 input capacitance c in all input pins except test and r2 15 pf f = 1 mhz, v in = 0 v test 15 pf f = 1 mhz, v in = 0 v 6 180 pf f = 1 mhz, v in = 0 v 7 r2 30 pf f = 1 mhz, v in = 0 v
hd404358 series 94 notes: 1. the oscillation stabilization time is the period required for the oscillator to stabilize in the following situations: a. after v cc reaches 2.7 v at power-on. b. after reset input goes low when stop mode is cancelled. c. after stopc input goes low when stop mode is cancelled. to ensure the oscillation stabilization time at power-on or when stop mode is cancelled, reset or stopc must be input for at least a duration of t rc . when using a crystal or ceramic oscillator, consult with the manufacturer to determine what stabilization time is required, since it will depend on the circuit constants and stray capacitance. 2. refer to figure 77. 3. refer to figure 78. 4. refer to figure 79. 5. refer to figure 80. 6. applies to the hd40a4354, hd40a4356, hd40a4358. 7. applies to the hd407a4359.
hd404358 series 95 serial interface timing characteristics (hd407a4359: v cc = 2.7 to 5.5 v, gnd = 0 v, t a = ?0 to +75 c; hd404354/hd404356/hd404358/hd40a4354/hd40a4356/hd40a4358: v cc = 2.7 to 6.0 v, gnd = 0 v, t a = ?0 to +75 c, unless otherwise specified) during transmit clock output item symbol pins min typ max unit test condition note transmit clock cycle time t scyc sck 1t cyc load shown in figure 82 1 transmit clock high width t sckh sck 0.4 t scyc load shown in figure 82 1 transmit clock low width t sckl sck 0.4 t scyc load shown in figure 82 1 transmit clock rise time t sckr sck 80 ns load shown in figure 82 1 transmit clock fall time t sckf sck 80 ns load shown in figure 82 1 serial output data delay time t dso so 300 ns load shown in figure 82 1 serial input data setup time t ssi si 100 ns 1 serial input data hold time t hsi si 200 ns 1 during transmit clock input item symbol pins min typ max unit test condition note transmit clock cycle time t scyc sck 1t cyc 1 transmit clock high width t sckh sck 0.4 t scyc 1 transmit clock low width t sckl sck 0.4 t scyc 1 transmit clock rise time t sckr sck 80ns 1 transmit clock fall time t sckf sck 80ns 1 serial output data delay time t dso so 300 ns load shown in figure 82 1 serial input data setup time t ssi si 100 ns 1 serial input data hold time t hsi si 200 ns 1 note: 1. refer to figure 81.
hd404358 series 96 t cpr t cpf v cc ?0.5 v 0.5 v osc 1 t cph t cpl 1/f cp figure 77 external clock timing 0.8v cc 0.2v cc int 0 , int 1 , evnb t ih t il figure 78 interrupt timing reset t rstr t rstl 0.2v cc 0.8v cc figure 79 reset timing t stpr t stpl 0.8v cc 0.2v cc stopc figure 80 stopc timing
hd404358 series 97 0.7v cc 0.3v cc t dso t sckf t sckl t ssi t hsi t scyc t sckr 0.4 v v ?0.5 v cc v ?0.5 v (0.8v ) * cc 0.4 v (0.2v ) * sck so si note: * v cc ?0.5 v and 0.4 v are the threshold voltages for transmit clock output, and 0.8v cc and 0.2v cc are the threshold voltages for transmit clock input. cc cc t sckh figure 81 serial interface timing r l = 2.6 k w v cc hitachi 1s2074 or equivalent r = 12 k w test point c = 30 pf figure 82 timing load circuit
hd404358 series 98 notes on rom out please pay attention to the following items regarding rom out. on rom out, fill the rom area indicated below with 1s to create the same data size for the hd404354, hd40a4354, hd404356 and hd40a4356 as an 8-kword version (hd404358, hd40a4358). the 8-kword and 16-kword data sizes are required to change rom data to mask manu facturing data since the program used is for an 8-k or 16-kword version. this limitation applies when using an eprom or a data base. vector address zero-page subroutine (64 words) pattern & program (4,096 words) not used rom 4-kword version: hd404354, hd40a4354 $0000 $000f $0010 $003f $0040 $0fff $1000 $1fff fill this area with 1s vector address zero-page subroutine (64 words) pattern & program (6,144 words) not used rom 6-kword version: hd404356, hd40a4356 $0000 $000f $0010 $003f $0040 $17ff $1800 $1fff
hd404358 series 99 hd404354/hd404356/hd404358/hd40a4354/hd40a4356/hd40a4358 please check off the appropriate applications and enter the necessary information. 2. rom code media date of order customer department name rom code name lsi number eprom: ceramic oscillator crystal oscillator external clock f = mhz f = mhz f = mhz 3. system oscillator (osc1, osc2) the upper bits and lower bits are mixed together. the upper five bits and lower five bits are programmed to the same eprom in alternating order (i.e., lululu...). eprom: the upper bits and lower bits are separated. the upper five bits and lower five bits are programmed to different eproms. 5 mhz operation 8.5 mhz operation 5 mhz operation 8.5 mhz operation 5 mhz operation 8.5 mhz operation hd404354 hd40a4354 hd404356 hd40a4356 hd404358 hd40a4358 4-kword 6-kword 8-kword 1. rom size dp-42s fp-44a 5. package please specify the first type below (the upper bits and lower bits are mixed together), when using the eprom on-package microcomputer type (including ztat version). used not used 4. stop mode
hd404358 series 100 cautions 1. hitachi neither warrants nor grants licenses of any rights of hitachi? or any third party? patent, copyright, trademark, or other intellectual property rights for information contained in this document. hitachi bears no responsibility for problems that may arise with third party? rights, including intellectual property rights, in connection with use of the information contained in this document. 2. products and product specifications may be subject to change without notice. confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. hitachi makes every attempt to ensure that its products are of high quality and reliability. however, contact hitachi? sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. design your application so that the product is used within the ranges guaranteed by hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail- safes, so that the equipment incorporating hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the hitachi product. 5. this product is not designed to be radiation resistant. 6. no one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from hitachi. 7. contact hitachi? sales office for any questions regarding this document or hitachi semiconductor products. hitachi, ltd. semiconductor & integrated circuits. nippon bldg., 2-6-2, ohte-machi, chiyoda-ku, tokyo 100-0004, japan tel: tokyo (03) 3270-2111 fax: (03) 3270-5109 copyright ?hitachi, ltd., 1998. all rights reserved. printed in japan. hitachi asia pte. ltd. 16 collyer quay #20-00 hitachi tower singapore 049318 tel: 535-2100 fax: 535-1533 url northamerica : http:semiconductor.hitachi.com/ europe : http://www.hitachi-eu.com/hel/ecg asia (singapore) : http://www.has.hitachi.com.sg/grp3/sicd/index.htm asia (taiwan) : http://www.hitachi.com.tw/e/product/sicd_frame.htm asia (hongkong) : http://www.hitachi.com.hk/eng/bo/grp3/index.htm japan : http://www.hitachi.co.jp/sicd/indx.htm hitachi asia ltd. taipei branch office 3f, hung kuo building. no.167, tun-hwa north road, taipei (105) tel: <886> (2) 2718-3666 fax: <886> (2) 2718-8180 hitachi asia (hong kong) ltd. group iii (electronic components) 7/f., north tower, world finance centre, harbour city, canton road, tsim sha tsui, kowloon, hong kong tel: <852> (2) 735 9218 fax: <852> (2) 730 0281 telex: 40815 hitec hx hitachi europe ltd. electronic components group. whitebrook park lower cookham road maidenhead berkshire sl6 8ya, united kingdom tel: <44> (1628) 585000 fax: <44> (1628) 778322 hitachi europe gmbh electronic components group dornacher stra? 3 d-85622 feldkirchen, munich germany tel: <49> (89) 9 9180-0 fax: <49> (89) 9 29 30 00 hitachi semiconductor (america) inc. 179 east tasman drive, san jose,ca 95134 tel: <1> (408) 433-1990 fax: <1>(408) 433-0223 for further information write to:


▲Up To Search▲   

 
Price & Availability of HD407A4359R

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X